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
authorJared Wein <jwein@mozilla.com>
Mon, 19 Sep 2016 15:40:28 -0400
changeset 314420 ee364270d3e60a036a5767bae738e9ee6cae5e81
parent 314419 1fdbce2821b589bff8e03407712646f7c6716756
child 314421 3edde45c1ee780de06b5bde61cfebf39e7a45ace
push id20574
push usercbook@mozilla.com
push dateTue, 20 Sep 2016 10:05:16 +0000
treeherderfx-team@14705f779a46 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
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