mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-03 23:30:46 +00:00
Bug 1017030 - Part 2: Replace AutoPushJSContext in ConsoleProfileRunnable::RunConsole. r=bholley
This commit is contained in:
parent
3719eaf169
commit
baba9f5388
@ -436,19 +436,18 @@ private:
|
||||
wp = wp->GetParent();
|
||||
}
|
||||
|
||||
AutoPushJSContext cx(wp->ParentJSContext());
|
||||
AutoJSAPI jsapi;
|
||||
JSContext* cx = jsapi.cx();
|
||||
ClearException ce(cx);
|
||||
|
||||
JS::Rooted<JSObject*> global(cx, JS::CurrentGlobalOrNull(cx));
|
||||
NS_ENSURE_TRUE_VOID(global);
|
||||
JSAutoCompartment ac(cx, global);
|
||||
|
||||
nsPIDOMWindow* window = wp->GetWindow();
|
||||
NS_ENSURE_TRUE_VOID(window);
|
||||
|
||||
nsRefPtr<nsGlobalWindow> win = static_cast<nsGlobalWindow*>(window);
|
||||
NS_ENSURE_TRUE_VOID(win);
|
||||
|
||||
JSAutoCompartment ac(cx, win->GetWrapperPreserveColor());
|
||||
|
||||
ErrorResult error;
|
||||
nsRefPtr<Console> console = win->GetConsole(error);
|
||||
if (error.Failed()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user