Bug 771977: terminate long running scripts if showing the slow script dialog fails (e.g. when the script is running in the hidden window), r=jst
authorGavin Sharp <gavin@gavinsharp.com>
Mon, 16 Jul 2012 11:44:09 -0700
changeset 99466 75b6ec6db468d4b90aca9ad493b63c9196eda9bf
parent 99465 e444abb9f5e697eec9f75c4178328774e7115148
child 99467 b3b880f37cd4dd6f8d77080170c93b1f541d3280
push id23135
push useremorley@mozilla.com
push dateTue, 17 Jul 2012 09:04:49 +0000
treeherdermozilla-central@ba8463beab13 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjst
bugs771977
milestone17.0a1
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 771977: terminate long running scripts if showing the slow script dialog fails (e.g. when the script is running in the hidden window), r=jst
dom/base/nsJSEnvironment.cpp
--- a/dom/base/nsJSEnvironment.cpp
+++ b/dom/base/nsJSEnvironment.cpp
@@ -826,17 +826,17 @@ nsJSContext::DOMOperationCallback(JSCont
 
   // Open the dialog.
   rv = prompt->ConfirmEx(title, msg, buttonFlags, waitButton, stopButton,
                          debugButton, neverShowDlg, &neverShowDlgChk,
                          &buttonPressed);
 
   ::JS_SetOperationCallback(cx, DOMOperationCallback);
 
-  if (NS_FAILED(rv) || (buttonPressed == 0)) {
+  if (NS_SUCCEEDED(rv) && (buttonPressed == 0)) {
     // Allow the script to continue running
 
     if (neverShowDlgChk) {
       Preferences::SetInt(isTrackingChromeCodeTime ?
         "dom.max_chrome_script_run_time" : "dom.max_script_run_time", 0);
     }
 
     ctx->mOperationCallbackTime = PR_Now();