Bug 1063529 - should catch shell service exceptions, r=mconley
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Wed, 24 Sep 2014 16:18:45 +0100
changeset 207469 240297b949aab7057f9619df2a6991dc4b82bd4b
parent 207468 8f7dd750e75fafc6460edd7f9fe6455029419f6c
child 207470 437731e3c70484efcb099a03c5beed7e0c1c788e
push id27555
push userryanvm@gmail.com
push dateFri, 26 Sep 2014 20:30:28 +0000
treeherderautoland@4ff52be673f6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley
bugs1063529
milestone35.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 1063529 - should catch shell service exceptions, r=mconley
browser/components/nsBrowserGlue.js
browser/components/preferences/in-content/main.js
browser/components/preferences/main.js
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -2158,17 +2158,21 @@ let DefaultBrowserCheck = {
       // In Windows 8, the UI for selecting default protocol is much
       // nicer than the UI for setting file type associations. So we
       // only show the protocol association screen on Windows 8.
       // Windows 8 is version 6.2.
       let version = Services.sysinfo.getProperty("version");
       claimAllTypes = (parseFloat(version) < 6.2);
     } catch (ex) { }
 #endif
-    ShellService.setDefaultBrowser(claimAllTypes, false);
+    try {
+      ShellService.setDefaultBrowser(claimAllTypes, false);
+    } catch (ex) {
+      Cu.reportError(ex);
+    }
     this.closePrompt();
   },
 
   _createPopup: function(win, bundle) {
     let doc = win.document;
     let popup = doc.createElement("menupopup");
     popup.id = this.OPTIONPOPUP;
 
--- a/browser/components/preferences/in-content/main.js
+++ b/browser/components/preferences/in-content/main.js
@@ -643,15 +643,20 @@ var gMainPane = {
   /**
    * Set browser as the operating system default browser.
    */
   setDefaultBrowser: function()
   {
     let shellSvc = getShellService();
     if (!shellSvc)
       return;
-    shellSvc.setDefaultBrowser(true, false);
+    try {
+      shellSvc.setDefaultBrowser(true, false);
+    } catch (ex) {
+      Cu.reportError(ex);
+      return;
+    }
     let selectedIndex =
       shellSvc.isDefaultBrowser(false, true) ? 1 : 0;
     document.getElementById("setDefaultPane").selectedIndex = selectedIndex;
   }
 #endif
 };
--- a/browser/components/preferences/main.js
+++ b/browser/components/preferences/main.js
@@ -495,15 +495,20 @@ var gMainPane = {
   /**
    * Set browser as the operating system default browser.
    */
   setDefaultBrowser: function()
   {
     let shellSvc = getShellService();
     if (!shellSvc)
       return;
-    shellSvc.setDefaultBrowser(true, false);
+    try {
+      shellSvc.setDefaultBrowser(true, false);
+    } catch (ex) {
+      Components.utils.reportError(ex);
+      return;
+    }
     let selectedIndex =
       shellSvc.isDefaultBrowser(false, true) ? 1 : 0;
     document.getElementById("setDefaultPane").selectedIndex = selectedIndex;
   }
 #endif
 };