mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 07:15:46 +00:00
Bug 796938 - Switch nsGlobalWindow::Focus to GetEntryGlobal and eliminate nsContentUtils::GetWindowFromCaller. r=smaug
This commit is contained in:
parent
ad265a7fcd
commit
b95633b27a
@ -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.
|
||||
|
@ -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()
|
||||
{
|
||||
|
@ -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));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user