Bug 1017030 - Part 2: Replace AutoPushJSContext in ConsoleProfileRunnable::RunConsole. r=bholley

This commit is contained in:
Bob Owen 2014-06-11 17:18:20 +01:00
parent 3719eaf169
commit baba9f5388

View File

@ -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()) {