Bug 1388145 - Move the UnsubmittedCrashReporter initialization to an idle callback. r=mconley draft
authorFelipe Gomes <felipc@gmail.com>
Wed, 09 Aug 2017 15:43:04 -0300
changeset 643420 a8f91c4db6b48ed4c075c05d4aac206b197dfc8e
parent 643406 e317326c3dc4a47f87ba86b29dc3dbdec2657f33
child 643421 3e426e84ca2acbbf76ef55c75c6560f8afc9ecfa
push id73095
push userfelipc@gmail.com
push dateWed, 09 Aug 2017 18:46:00 +0000
reviewersmconley
bugs1388145
milestone57.0a1
Bug 1388145 - Move the UnsubmittedCrashReporter initialization to an idle callback. r=mconley MozReview-Commit-ID: IZCLlhCbNQN
browser/components/nsBrowserGlue.js
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -1101,19 +1101,16 @@ BrowserGlue.prototype = {
     }
 
     if (AddonManager.nonMpcDisabled) {
       this._notifyDisabledNonMpc();
     }
 
     if (AppConstants.MOZ_CRASHREPORTER) {
       UnsubmittedCrashHandler.init();
-      Services.tm.idleDispatchToMainThread(function() {
-        UnsubmittedCrashHandler.checkForUnsubmittedCrashReports();
-      });
     }
 
     this._sanitizer.onStartup();
     E10SAccessibilityCheck.onWindowsRestored();
 
     this._scheduleStartupIdleTasks();
 
     this._lateTasksIdleObserver = (idleService, topic, data) => {
@@ -1154,16 +1151,22 @@ BrowserGlue.prototype = {
     });
 
     // It's important that SafeBrowsing is initialized reasonably
     // early, so we use a maximum timeout for it.
     Services.tm.idleDispatchToMainThread(() => {
       SafeBrowsing.init();
     }, 5000);
 
+    if (AppConstants.MOZ_CRASHREPORTER) {
+      Services.tm.idleDispatchToMainThread(() => {
+        UnsubmittedCrashHandler.checkForUnsubmittedCrashReports();
+      });
+    }
+
     Services.tm.idleDispatchToMainThread(() => {
       this._checkForDefaultBrowser();
     });
   },
 
   /**
    * Use this function as an entry point to schedule tasks that need
    * to run once per session, at any arbitrary point in time.