Bug 889714 - Remove ContextCallback junk. r=mrbkap
☠☠ backed out by 659b0d61fbc6 ☠ ☠
authorBobby Holley <bobbyholley@gmail.com>
Thu, 25 Jul 2013 11:29:21 -0700
changeset 148054 eaf22159cd3e44c1f279a3c0f3951e2a281bafab
parent 148053 142c7afd4ec5d193bb62da5679f46db99b78c4c1
child 148055 a3f028f1f05ee96dc6ec025c260c056326cfff15
push id2697
push userbbajaj@mozilla.com
push dateMon, 05 Aug 2013 18:49:53 +0000
treeherdermozilla-beta@dfec938c7b63 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmrbkap
bugs889714
milestone24.0a2
Bug 889714 - Remove ContextCallback junk. r=mrbkap There's no reason we should be doing this.
ipc/testshell/XPCShellEnvironment.cpp
--- a/ipc/testshell/XPCShellEnvironment.cpp
+++ b/ipc/testshell/XPCShellEnvironment.cpp
@@ -81,31 +81,16 @@ Environment(JSObject* global)
     if (!JS_GetProperty(cx, global, "__XPCShellEnvironment", v.address()) ||
         !v.get().isDouble())
     {
         return nullptr;
     }
     return static_cast<XPCShellEnvironment*>(v.get().toPrivate());
 }
 
-JSContextCallback gOldContextCallback = NULL;
-
-static JSBool
-ContextCallback(JSContext *cx,
-                unsigned contextOp)
-{
-    if (gOldContextCallback && !gOldContextCallback(cx, contextOp))
-        return JS_FALSE;
-
-    if (contextOp == JSCONTEXT_NEW) {
-        JS_SetErrorReporter(cx, xpc::SystemErrorReporter);
-    }
-    return JS_TRUE;
-}
-
 static JSBool
 Print(JSContext *cx,
       unsigned argc,
       JS::Value *vp)
 {
     unsigned i, n;
     JSString *str;
 
@@ -580,22 +565,16 @@ XPCShellEnvironment::~XPCShellEnvironmen
         {
             JSAutoCompartment ac(cx, global);
             JS_SetAllNonReservedSlotsToUndefined(cx, global);
         }
         mGlobalHolder.Release();
 
         JSRuntime *rt = JS_GetRuntime(cx);
         JS_GC(rt);
-
-        if (gOldContextCallback) {
-            NS_ASSERTION(rt, "Should never be null!");
-            JS_SetContextCallback(rt, gOldContextCallback);
-            gOldContextCallback = NULL;
-        }
     }
 }
 
 bool
 XPCShellEnvironment::Init()
 {
     nsresult rv;
 
@@ -618,17 +597,16 @@ XPCShellEnvironment::Init()
         return false;
     }
 
     if (!mGlobalHolder.Hold(rt)) {
         NS_ERROR("Can't protect global object!");
         return false;
     }
 
-    gOldContextCallback = JS_SetContextCallback(rt, ContextCallback);
     AutoSafeJSContext cx;
 
     JS_SetContextPrivate(cx, this);
 
     nsCOMPtr<nsIXPConnect> xpc =
       do_GetService(nsIXPConnect::GetCID());
     if (!xpc) {
         NS_ERROR("failed to get nsXPConnect service!");