From 3719eaf1694a39ccd0703b1155604bf0616dcd2f Mon Sep 17 00:00:00 2001 From: Bob Owen Date: Fri, 30 May 2014 10:38:30 +0100 Subject: [PATCH] Bug 1017030 - Part 1: Replace AutoPushJSContext in ConsoleCallDataRunnable::RunConsole. r=bholley --- dom/base/Console.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dom/base/Console.cpp b/dom/base/Console.cpp index 323eed4a8b3c..7cecf9f3e55c 100644 --- a/dom/base/Console.cpp +++ b/dom/base/Console.cpp @@ -15,6 +15,7 @@ #include "nsGlobalWindow.h" #include "nsJSUtils.h" #include "nsPerformance.h" +#include "ScriptSettings.h" #include "WorkerPrivate.h" #include "WorkerRunnable.h" #include "xpcprivate.h" @@ -323,7 +324,8 @@ private: wp = wp->GetParent(); } - AutoPushJSContext cx(wp->ParentJSContext()); + AutoJSAPI jsapi; + JSContext* cx = jsapi.cx(); ClearException ce(cx); nsPIDOMWindow* window = wp->GetWindow(); @@ -332,6 +334,8 @@ private: nsRefPtr win = static_cast(window); NS_ENSURE_TRUE_VOID(win); + JSAutoCompartment ac(cx, win->GetWrapperPreserveColor()); + ErrorResult error; nsRefPtr console = win->GetConsole(error); if (error.Failed()) {