Bug 1303380 - Wrap the telemetry code in _firstWindowLoaded with a try/catch to allow startup and migration code to run to completion if there is an exception writing to Telemetry. r?gijs draft
authorJared Wein <jwein@mozilla.com>
Mon, 19 Sep 2016 15:40:28 -0400
changeset 415167 034a9c0959af3d17618683a8b44d442445d60529
parent 415166 d3371dc084b4c65fee1828d0d50d7a36ea15a681
child 415503 a37b47bd90f3054ec5e5d22ec041c1a83da02ab9
push id29806
push userbmo:jaws@mozilla.com
push dateMon, 19 Sep 2016 19:41:01 +0000
reviewersgijs
bugs1303380
milestone51.0a1
Bug 1303380 - Wrap the telemetry code in _firstWindowLoaded with a try/catch to allow startup and migration code to run to completion if there is an exception writing to Telemetry. r?gijs MozReview-Commit-ID: DPfq6lZ4fM3
browser/components/nsBrowserGlue.js
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -926,17 +926,19 @@ BrowserGlue.prototype = {
         SCALING_PROBE_NAME = "DISPLAY_SCALING_OSX";
         break;
       case "linux":
         SCALING_PROBE_NAME = "DISPLAY_SCALING_LINUX";
         break;
     }
     if (SCALING_PROBE_NAME) {
       let scaling = aWindow.devicePixelRatio * 100;
-      Services.telemetry.getHistogramById(SCALING_PROBE_NAME).add(scaling);
+      try {
+        Services.telemetry.getHistogramById(SCALING_PROBE_NAME).add(scaling);
+      } catch (ex) {}
     }
   },
 
   // the first browser window has finished initializing
   _onFirstWindowLoaded: function BG__onFirstWindowLoaded(aWindow) {
     // Initialize PdfJs when running in-process and remote. This only
     // happens once since PdfJs registers global hooks. If the PdfJs
     // extension is installed the init method below will be overridden