Bug 801114 - Remove JSD's unused out-of-memory hook; r=billm
authorTerrence Cole <terrence@mozilla.com>
Fri, 19 Oct 2012 10:49:48 -0700
changeset 110932 d1984b76a0b2156fc6b408adc3b420a913caeb18
parent 110931 8559d650b22dd3f3253b767248dbde5e691f6d48
child 110933 09dc2dc1fc9fdd24048265e69b7c63e89bd879af
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewersbillm
bugs801114
milestone19.0a1
Bug 801114 - Remove JSD's unused out-of-memory hook; r=billm
content/canvas/test/test_mozGetAsFile.html
dom/base/test/test_gsp-standards.html
dom/bindings/BindingGen.py
dom/tests/mochitest/chrome/file_bug799299.xul
dom/tests/mochitest/chrome/test_bug799299.xul
js/src/jscntxt.cpp
--- a/js/src/jscntxt.cpp
+++ b/js/src/jscntxt.cpp
@@ -646,31 +646,21 @@ js_ReportOutOfMemory(JSContext *cx)
 
     /* Fill out the report, but don't do anything that requires allocation. */
     PodZero(&report);
     report.flags = JSREPORT_ERROR;
     report.errorNumber = JSMSG_OUT_OF_MEMORY;
     PopulateReportBlame(cx, &report);
 
     /*
-     * If debugErrorHook is present then we give it a chance to veto sending
-     * the error on to the regular ErrorReporter. We also clear a pending
-     * exception if any now so the hooks can replace the out-of-memory error
-     * by a script-catchable exception.
+     * We clear a pending exception, if any, now so the hook can replace the
+     * out-of-memory error by a script-catchable exception.
      */
     cx->clearPendingException();
     if (onError) {
-        JSDebugErrorHook hook = cx->runtime->debugHooks.debugErrorHook;
-        if (hook &&
-            !hook(cx, msg, &report, cx->runtime->debugHooks.debugErrorHookData)) {
-            onError = NULL;
-        }
-    }
-
-    if (onError) {
         AutoAtomicIncrement incr(&cx->runtime->inOOMReport);
         onError(cx, msg, &report);
     }
 }
 
 JS_FRIEND_API(void)
 js_ReportOverRecursed(JSContext *maybecx)
 {