Bug 780168 - Avoid a couple QIs in nsDocShell::GetInterface(nsIDocument); r=bz

This commit is contained in:
Ms2ger 2012-08-04 09:44:01 +02:00
parent 26ec93ab7a
commit ffdeefc990

View File

@ -951,11 +951,9 @@ NS_IMETHODIMP nsDocShell::GetInterface(const nsIID & aIID, void **aSink)
}
else if (aIID.Equals(NS_GET_IID(nsIDocument)) &&
NS_SUCCEEDED(EnsureContentViewer())) {
nsCOMPtr<nsIDOMDocument> domDoc;
mContentViewer->GetDOMDocument(getter_AddRefs(domDoc));
if (!domDoc)
return NS_NOINTERFACE;
return domDoc->QueryInterface(aIID, aSink);
nsCOMPtr<nsIDocument> doc = mContentViewer->GetDocument();
doc.forget(aSink);
return *aSink ? NS_OK : NS_NOINTERFACE;
}
else if (aIID.Equals(NS_GET_IID(nsIApplicationCacheContainer))) {
*aSink = nullptr;