Bug 796938 - Switch nsGlobalWindow::Focus to GetEntryGlobal and eliminate nsContentUtils::GetWindowFromCaller. r=smaug

This commit is contained in:
Bobby Holley 2014-08-19 12:02:05 -07:00
parent a54113a4dd
commit e1824e5875
3 changed files with 1 additions and 20 deletions

View File

@ -404,12 +404,6 @@ public:
// aWindow can be either outer or inner window.
static bool CanCallerAccess(nsPIDOMWindow* aWindow);
/**
* Get the window through the JS context that's currently on the stack.
* If there's no JS context currently on the stack, returns null.
*/
static nsPIDOMWindow *GetWindowFromCaller();
/**
* The two GetDocumentFrom* functions below allow a caller to get at a
* document that is relevant to the currently executing script.

View File

@ -1953,19 +1953,6 @@ nsContentUtils::TraceSafeJSContext(JSTracer* aTrc)
}
}
nsPIDOMWindow *
nsContentUtils::GetWindowFromCaller()
{
JSContext *cx = GetCurrentJSContext();
if (cx) {
nsCOMPtr<nsPIDOMWindow> win =
do_QueryInterface(nsJSUtils::GetDynamicScriptGlobal(cx));
return win;
}
return nullptr;
}
nsIDocument*
nsContentUtils::GetDocumentFromCaller()
{

View File

@ -6558,7 +6558,7 @@ nsGlobalWindow::Focus(ErrorResult& aError)
return;
}
nsIDOMWindow *caller = nsContentUtils::GetWindowFromCaller();
nsCOMPtr<nsIDOMWindow> caller = do_QueryInterface(GetEntryGlobal());
nsCOMPtr<nsIDOMWindow> opener;
GetOpener(getter_AddRefs(opener));