Bug 889714 - Remove ContextCallback junk. r=mrbkap
authorBobby Holley <bobbyholley@gmail.com>
Wed, 31 Jul 2013 10:59:26 -0700
changeset 148172 589c2607f15e1595b935aa02c6840bec53261f1f
parent 148171 b932a3fb643167afa64601690583a527972cbddc
child 148173 583def76458583db239dd2fa2623a2bb18cc8a36
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!");