Bug 626830 - XPConnect should turn debugging off immediately, without waiting for a quiescent stack
☠☠ backed out by c52e5d68a747 ☠ ☠
authorSteve Fink <sfink@mozilla.com>
Mon, 24 Jan 2011 13:24:52 -0800
changeset 61239 d54eac606dd725129d2d18324aac1ca73e652e68
parent 61238 b7e91bafdcd9b826f145199105d5ab1c2fab8978
child 61240 c10e63cba3b67bb7486d1d119ac4422e9781b258
push id18277
push usercleary@mozilla.com
push dateTue, 25 Jan 2011 03:52:51 +0000
treeherdermozilla-central@7ee91bd90e7a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs626830
milestone2.0b10pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 626830 - XPConnect should turn debugging off immediately, without waiting for a quiescent stack
js/src/xpconnect/src/nsXPConnect.cpp
--- a/js/src/xpconnect/src/nsXPConnect.cpp
+++ b/js/src/xpconnect/src/nsXPConnect.cpp
@@ -2503,17 +2503,18 @@ nsXPConnect::Push(JSContext * cx)
         bool runningJS = false;
         for (PRUint32 i = 0; i < stack->Length(); ++i) {
             JSContext *cx = (*stack)[i].cx;
             if (cx && cx->regs) {
                 runningJS = true;
                 break;
             }
         }
-        if (!runningJS)
+        /* Turning debugging off is immediate even if JS is running */
+        if (!runningJS || !gDesiredDebugMode)
             CheckForDebugMode(mRuntime->GetJSRuntime());
     }
 
     return data->GetJSContextStack()->Push(cx);
 }
 
 /* attribute JSContext SafeJSContext; */
 NS_IMETHODIMP
@@ -2772,16 +2773,18 @@ nsXPConnect::Base64Decode(JSContext *cx,
     *out = STRING_TO_JSVAL(str);
     return JS_TRUE;
 }
 
 NS_IMETHODIMP
 nsXPConnect::SetDebugModeWhenPossible(PRBool mode)
 {
     gDesiredDebugMode = mode;
+    if (!mode)
+        CheckForDebugMode(mRuntime->GetJSRuntime());
     return NS_OK;
 }
 
 /* These are here to be callable from a debugger */
 JS_BEGIN_EXTERN_C
 JS_EXPORT_API(void) DumpJSStack()
 {
     nsresult rv;