Bug 1017030 - Part 4: Replace AutoPushJSContext in nsJSContext::InitClasses. r=bholley

This commit is contained in:
Bob Owen 2014-06-11 17:31:24 +01:00
parent da11aafb63
commit ff160cb692

View File

@ -39,6 +39,7 @@
#include "nsXPCOMCIDInternal.h" #include "nsXPCOMCIDInternal.h"
#include "nsIXULRuntime.h" #include "nsIXULRuntime.h"
#include "nsTextFormatter.h" #include "nsTextFormatter.h"
#include "ScriptSettings.h"
#include "xpcpublic.h" #include "xpcpublic.h"
@ -1632,7 +1633,9 @@ nsresult
nsJSContext::InitClasses(JS::Handle<JSObject*> aGlobalObj) nsJSContext::InitClasses(JS::Handle<JSObject*> aGlobalObj)
{ {
JSOptionChangedCallback(js_options_dot_str, this); JSOptionChangedCallback(js_options_dot_str, this);
AutoPushJSContext cx(mContext); AutoJSAPI jsapi;
JSContext* cx = jsapi.cx();
JSAutoCompartment ac(cx, aGlobalObj);
// Attempt to initialize profiling functions // Attempt to initialize profiling functions
::JS_DefineProfilingFunctions(cx, aGlobalObj); ::JS_DefineProfilingFunctions(cx, aGlobalObj);