Backed out changeset dedd83e6d526 (bug 1191242) for being the wrong version of the patch a=backout
authorWes Kocher <wkocher@mozilla.com>
Fri, 04 Sep 2015 14:46:45 -0700
changeset 289135 2fb8aea29b0c8591c238559d57a3885e694984da
parent 289134 2687ae28ea37f732981b3453b9b0de205e6f6bc9
child 289136 6eb32a550136fd5fd7cb97d0f7b3a0799d661af9
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1191242
milestone42.0a2
backs outdedd83e6d52615d30eacc318db9e9a33d6318079
Backed out changeset dedd83e6d526 (bug 1191242) for being the wrong version of the patch a=backout
browser/components/nsBrowserGlue.js
toolkit/components/telemetry/Histograms.json
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -1215,53 +1215,31 @@ BrowserGlue.prototype = {
         let ss = Cc["@mozilla.org/browser/sessionstartup;1"].
                  getService(Ci.nsISessionStartup);
         willRecoverSession =
           (ss.sessionType == Ci.nsISessionStartup.RECOVER_SESSION);
       }
       catch (ex) { /* never mind; suppose SessionStore is broken */ }
 
       // startup check, check all assoc
-      let isDefault = false;
-      let isDefaultError = false;
-      try {
-        isDefault = ShellService.isDefaultBrowser(true, false);
-      } catch (ex) {
-        isDefaultError = true;
-      }
-
-      if (isDefault) {
-        let now = (Math.floor(Date.now() / 1000)).toString();
-        Services.prefs.setCharPref("browser.shell.mostRecentDateSetAsDefault", now);
-      }
-
-      let willPrompt = shouldCheck && !isDefault && !willRecoverSession;
-
+      let isDefault = ShellService.isDefaultBrowser(true, false);
       try {
         // Report default browser status on startup to telemetry
         // so we can track whether we are the default.
         Services.telemetry.getHistogramById("BROWSER_IS_USER_DEFAULT")
                           .add(isDefault);
-        Services.telemetry.getHistogramById("BROWSER_IS_USER_DEFAULT_ERROR")
-                          .add(isDefaultError);
-        Services.telemetry.getHistogramById("BROWSER_SET_DEFAULT_ALWAYS_CHECK")
-                          .add(shouldCheck);
-        let promptCount =
-          Services.prefs.getIntPref("browser.shell.defaultBrowserCheckCount");
-        if (willPrompt) {
-          promptCount++;
-        }
-        Services.telemetry.getHistogramById("BROWSER_SET_DEFAULT_DIALOG_PROMPT_RAWCOUNT")
-                          .add(promptCount);
-        Services.prefs.setIntPref("browser.shell.defaultBrowserCheckCount",
-                                  promptCount)
       }
       catch (ex) { /* Don't break the default prompt if telemetry is broken. */ }
 
-      if (willPrompt) {
+      if (isDefault) {
+        let now = Date.now().toString().slice(0, -3);
+        Services.prefs.setCharPref("browser.shell.mostRecentDateSetAsDefault", now);
+      }
+
+      if (shouldCheck && !isDefault && !willRecoverSession) {
         Services.tm.mainThread.dispatch(function() {
           DefaultBrowserCheck.prompt(RecentWindow.getMostRecentBrowserWindow());
         }.bind(this), Ci.nsIThread.DISPATCH_NORMAL);
       }
     }
 
 #ifdef E10S_TESTING_ONLY
     E10SUINotification.checkStatus();
@@ -2743,79 +2721,40 @@ ContentPermissionPrompt.prototype = {
       break;
     }
   },
 
 };
 
 let DefaultBrowserCheck = {
   get OPTIONPOPUP() { return "defaultBrowserNotificationPopup" },
-  _setAsDefaultTimer: null,
-  _setAsDefaultButtonClickStartTime: 0,
 
   closePrompt: function(aNode) {
     if (this._notification) {
       this._notification.close();
     }
   },
 
   setAsDefault: function() {
     let claimAllTypes = true;
-    let setAsDefaultError = false;
 #ifdef XP_WIN
     try {
       // 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
     try {
       ShellService.setDefaultBrowser(claimAllTypes, false);
-
-      if (this._setAsDefaultTimer) {
-        this._setAsDefaultTimer.cancel();
-      }
-
-      this._setAsDefaultButtonClickStartTime = Math.floor(Date.now() / 1000);
-      this._setAsDefaultTimer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
-      this._setAsDefaultTimer.init(function() {
-        let isDefault = false;
-        let isDefaultError = false;
-        try {
-          isDefault = ShellService.isDefaultBrowser(true, false);
-        } catch (ex) {
-          isDefaultError = true;
-        }
-
-        let now = Math.floor(Date.now() / 1000);
-        let runTime = now - this._setAsDefaultButtonClickStartTime;
-        if (isDefault || runTime > 600) {
-          this._setAsDefaultTimer.cancel();
-          this._setAsDefaultTimer = null;
-          Services.telemetry.getHistogramById("BROWSER_SET_DEFAULT_TIME_TO_COMPLETION_SECONDS")
-                            .add(runTime);
-        }
-        Services.telemetry.getHistogramById("BROWSER_IS_USER_DEFAULT_ERROR")
-                          .add(isDefaultError);
-      }, 1000, Ci.nsITimer.TYPE_REPEATING_SLACK);
     } catch (ex) {
-      setAsDefaultError = true;
       Cu.reportError(ex);
     }
-    // Here BROWSER_IS_USER_DEFAULT and BROWSER_SET_USER_DEFAULT_ERROR appear
-    // to be inverse of each other, but that is only because this function is
-    // called when the browser is set as the default. During startup we record
-    // the BROWSER_IS_USER_DEFAULT value without recording BROWSER_SET_USER_DEFAULT_ERROR.
-    Services.telemetry.getHistogramById("BROWSER_IS_USER_DEFAULT")
-                      .add(!setAsDefaultError);
-    Services.telemetry.getHistogramById("BROWSER_SET_DEFAULT_ERROR")
-                      .add(setAsDefaultError);
   },
 
   _createPopup: function(win, notNowStrings, neverStrings) {
     let doc = win.document;
     let popup = doc.createElement("menupopup");
     popup.id = this.OPTIONPOPUP;
 
     let notNowItem = doc.createElement("menuitem");
@@ -2917,22 +2856,16 @@ let DefaultBrowserCheck = {
                         ps.BUTTON_POS_0_DEFAULT;
       let rv = ps.confirmEx(win, promptTitle, promptMessage, buttonFlags,
                             yesButton, notNowButton, null, askLabel, shouldAsk);
       if (rv == 0) {
         this.setAsDefault();
       } else if (!shouldAsk.value) {
         ShellService.shouldCheckDefaultBrowser = false;
       }
-
-      try {
-        let resultEnum = rv * 2 + shouldAsk.value;
-        Services.telemetry.getHistogramById("BROWSER_SET_DEFAULT_RESULT")
-                          .add(resultEnum);
-      } catch (ex) { /* Don't break if Telemetry is acting up. */ }
     }
   },
 
   _onNotificationEvent: function(eventType) {
     if (eventType == "removed") {
       let doc = this._notification.ownerDocument;
       let popup = doc.getElementById(this.OPTIONPOPUP);
       popup.removeEventListener("command", this);
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -7238,54 +7238,18 @@
     "kind": "linear",
     "high": "10000000",
     "n_buckets": "10000",
     "description": "The number of edges serialized into a heap snapshot."
   },
   "BROWSER_IS_USER_DEFAULT": {
     "expires_in_version": "never",
     "kind": "boolean",
-    "releaseChannelCollection": "opt-out",
     "description": "The result of the startup default desktop browser check."
   },
-  "BROWSER_IS_USER_DEFAULT_ERROR": {
-    "expires_in_version": "never",
-    "kind": "boolean",
-    "releaseChannelCollection": "opt-out",
-    "description": "True if the browser was unable to determine if the browser was set as default."
-  },
-  "BROWSER_SET_DEFAULT_DIALOG_PROMPT_RAWCOUNT": {
-    "expires_in_version": "never",
-    "kind": "exponential",
-    "high": "250",
-    "n_buckets": "15",
-    "releaseChannelCollection": "opt-out",
-    "description": "The number of times that a profile has seen the 'Set Default Browser' dialog."
-  },
-  "BROWSER_SET_DEFAULT_RESULT": {
-    "expires_in_version": "never",
-    "kind": "enumerated",
-    "n_values": "4",
-    "releaseChannelCollection": "opt-out",
-    "description": "Result of the Set Default Browser dialog (0=Use Firefox + 'Always perform check' unchecked, 1=Use Firefox + 'Always perform check' checked, 2=Not Now + 'Always perform check' unchecked, 3=Not Now + 'Always perform check' checked)"
-  },
-  "BROWSER_SET_DEFAULT_ERROR": {
-    "expires_in_version": "never",
-    "kind": "boolean",
-    "releaseChannelCollection": "opt-out",
-    "description": "True if the browser was unable to set Firefox as the default browser"
-  },
-  "BROWSER_SET_DEFAULT_TIME_TO_COMPLETION_SECONDS": {
-    "expires_in_version": "never",
-    "kind": "exponential",
-    "high": "500",
-    "n_buckets": "15",
-    "releaseChannelCollection": "opt-out",
-    "description": "Time to successfully set Firefox as the default browser after clicking 'Set Firefox as Default'. Should be near-instant in some environments, others require user interaction. Measured in seconds."
-  },
   "BROWSER_IS_ASSIST_DEFAULT": {
     "expires_in_version": "never",
     "kind": "boolean",
     "description": "The result of the default browser check for assist intent."
   },
   "MIXED_CONTENT_PAGE_LOAD": {
     "expires_in_version": "never",
     "kind": "enumerated",