Bug 1311016 - Make Firefox honor MOZ_CRASHREPORTER_SHUTDOWN environment variable to quit browser on content process crash r=mconley
authorHenrik Skupin <mail@hskupin.info>
Tue, 25 Oct 2016 16:28:56 +0200
changeset 319309 f7a9e4b0905510c33b214386122516819edd6349
parent 319308 38ac5c0d5d5579c2322b538ba510b411aaa159dd
child 319310 bf39193c8b6efec6578b01140b2afe42aa74673e
push id30869
push userphilringnalda@gmail.com
push dateWed, 26 Oct 2016 04:57:48 +0000
treeherdermozilla-central@9471b3c49b2c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley
bugs1311016
milestone52.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 1311016 - Make Firefox honor MOZ_CRASHREPORTER_SHUTDOWN environment variable to quit browser on content process crash r=mconley MozReview-Commit-ID: AqahXlLYLzo
browser/modules/ContentCrashHandlers.jsm
--- a/browser/modules/ContentCrashHandlers.jsm
+++ b/browser/modules/ContentCrashHandlers.jsm
@@ -109,16 +109,26 @@ this.TabCrashHandler = {
           // this list from getting too large by putting a reasonable upper
           // limit on how many childIDs we track. It's unlikely that this
           // array would ever get so large as to be unwieldy (that'd be a lot
           // or crashes!), but a leak is a leak.
           if (this.unseenCrashedChildIDs.length > MAX_UNSEEN_CRASHED_CHILD_IDS) {
             this.unseenCrashedChildIDs.shift();
           }
         }
+
+        // check for environment affecting crash reporting
+        let env = Cc["@mozilla.org/process/environment;1"]
+                    .getService(Ci.nsIEnvironment);
+        let shutdown = env.exists("MOZ_CRASHREPORTER_SHUTDOWN");
+
+        if (shutdown) {
+          Services.startup.quit(Ci.nsIAppStartup.eForceQuit);
+        }
+
         break;
       }
       case "oop-frameloader-crashed": {
         aSubject.QueryInterface(Ci.nsIFrameLoader);
 
         let browser = aSubject.ownerElement;
         if (!browser) {
           return;