Bug 1666783 - Remove nsIDocShell::GetInterface(nsISHistory). r=smaug

Also assert that it's never used.

Differential Revision: https://phabricator.services.mozilla.com/D91142
This commit is contained in:
Andreas Farre
2020-09-24 13:28:41 +00:00
parent 853c8a61e5
commit 6054cba163
5 changed files with 20 additions and 18 deletions

View File

@@ -693,13 +693,10 @@ nsDocShell::GetInterface(const nsIID& aIID, void** aSink) {
? NS_OK
: NS_NOINTERFACE;
} else if (aIID.Equals(NS_GET_IID(nsISHistory))) {
RefPtr<ChildSHistory> shistory = GetSessionHistory();
if (shistory) {
// XXX(nika): Stop exposing nsISHistory through GetInterface.
nsCOMPtr<nsISHistory> legacy = shistory->LegacySHistory();
legacy.forget(aSink);
return NS_OK;
}
// This is deprecated, you should instead directly get
// ChildSHistory from the browsing context.
MOZ_DIAGNOSTIC_ASSERT(
false, "Do not try to get a nsISHistory interface from nsIDocShell");
return NS_NOINTERFACE;
} else if (aIID.Equals(NS_GET_IID(nsIWebBrowserFind))) {
nsresult rv = EnsureFind();