зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1179069 - Remove docshell warnings in embedding. r=bz
This commit is contained in:
Родитель
a8f980f306
Коммит
2b7467a741
|
@ -76,11 +76,15 @@ using namespace mozilla::dom;
|
|||
static nsresult
|
||||
GetDOMEventTarget(nsWebBrowser* aInBrowser, EventTarget** aTarget)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aInBrowser);
|
||||
if (!aInBrowser) {
|
||||
return NS_ERROR_INVALID_POINTER;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDOMWindow> domWindow;
|
||||
aInBrowser->GetContentDOMWindow(getter_AddRefs(domWindow));
|
||||
NS_ENSURE_TRUE(domWindow, NS_ERROR_FAILURE);
|
||||
if (!domWindow) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsPIDOMWindow> domWindowPrivate = do_QueryInterface(domWindow);
|
||||
NS_ENSURE_TRUE(domWindowPrivate, NS_ERROR_FAILURE);
|
||||
|
|
|
@ -360,7 +360,10 @@ nsWebBrowser::SetParentURIContentListener(
|
|||
NS_IMETHODIMP
|
||||
nsWebBrowser::GetContentDOMWindow(nsIDOMWindow** aResult)
|
||||
{
|
||||
NS_ENSURE_STATE(mDocShell);
|
||||
if (!mDocShell) {
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDOMWindow> retval = mDocShell->GetWindow();
|
||||
retval.forget(aResult);
|
||||
return *aResult ? NS_OK : NS_ERROR_FAILURE;
|
||||
|
|
Загрузка…
Ссылка в новой задаче