Make this code deal with setTimeout from a component. bug 414743, r=jst/waldo sr=jst

This commit is contained in:
mrbkap@gmail.com 2008-01-29 21:30:11 -08:00
parent 27b1c94b51
commit 3ef2e3c36b
2 changed files with 5 additions and 2 deletions

View File

@ -5010,8 +5010,8 @@ nsGlobalWindow::GetFrames(nsIDOMWindow** aFrames)
return NS_OK;
}
static nsGlobalWindow*
CallerInnerWindow()
nsGlobalWindow*
nsGlobalWindow::CallerInnerWindow()
{
nsAXPCNativeCallContext *ncc;
nsresult rv = nsContentUtils::XPConnect()->GetCurrentNativeCallContext(&ncc);
@ -5041,6 +5041,8 @@ CallerInnerWindow()
// raw pointer here and let the QI's addref be balanced by the nsCOMPtr
// destructor's release.
nsCOMPtr<nsPIDOMWindow> win = do_QueryWrappedNative(wrapper);
if (!win)
return GetCurrentInnerWindowInternal();
return static_cast<nsGlobalWindow*>(win.get());
}

View File

@ -435,6 +435,7 @@ protected:
void ClearControllers();
void FreeInnerObjects(PRBool aClearScope);
nsGlobalWindow *CallerInnerWindow();
nsresult SetNewDocument(nsIDocument *aDocument,
nsISupports *aState,