Bug 1255253 - Remove a mostly-unneeded countLogins() call. r=MattN
authorJustin Dolske <dolske@mozilla.com>
Thu, 26 May 2016 18:49:03 -0700
changeset 338295 f7bfb9a0184ae6110e3daa919d5081320418f57c
parent 338294 f2125a888d23ff0a5b6df4c31bc66f0132610750
child 338296 4a7a28982402ba18d512b8d5cefa52b504d4ad9c
push id6249
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 13:59:36 +0000
treeherdermozilla-beta@bad9d4f5bf7e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMattN
bugs1255253
milestone49.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 1255253 - Remove a mostly-unneeded countLogins() call. r=MattN MozReview-Commit-ID: 5L1SdtZA9aU
toolkit/components/passwordmgr/LoginManagerParent.jsm
toolkit/components/telemetry/Histograms.json
toolkit/components/telemetry/histogram-whitelists.json
--- a/toolkit/components/passwordmgr/LoginManagerParent.jsm
+++ b/toolkit/components/passwordmgr/LoginManagerParent.jsm
@@ -164,31 +164,16 @@ var LoginManagerParent = {
           recipes,
         });
       } catch (e) {
         log("error sending message to target", e);
       }
       return;
     }
 
-    let allLoginsCount = Services.logins.countLogins(formOrigin, "", null);
-    // If there are no logins for this site, bail out now.
-    if (!allLoginsCount) {
-      try {
-        target.sendAsyncMessage("RemoteLogins:loginsFound", {
-          requestId: requestId,
-          logins: [],
-          recipes,
-        });
-      } catch (e) {
-        log("error sending message to target", e);
-      }
-      return;
-    }
-
     // If we're currently displaying a master password prompt, defer
     // processing this form until the user handles the prompt.
     if (Services.logins.uiBusy) {
       log("deferring sendLoginDataToChild for", formOrigin);
       let self = this;
       let observer = {
         QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
                                                Ci.nsISupportsWeakReference]),
@@ -226,26 +211,16 @@ var LoginManagerParent = {
     // Convert the array of nsILoginInfo to vanilla JS objects since nsILoginInfo
     // doesn't support structured cloning.
     var jsLogins = LoginHelper.loginsToVanillaObjects(logins);
     target.sendAsyncMessage("RemoteLogins:loginsFound", {
       requestId: requestId,
       logins: jsLogins,
       recipes,
     });
-
-    const PWMGR_FORM_ACTION_EFFECT =  Services.telemetry.getHistogramById("PWMGR_FORM_ACTION_EFFECT");
-    if (logins.length == 0) {
-      PWMGR_FORM_ACTION_EFFECT.add(2);
-    } else if (logins.length == allLoginsCount) {
-      PWMGR_FORM_ACTION_EFFECT.add(0);
-    } else {
-      // logins.length < allLoginsCount
-      PWMGR_FORM_ACTION_EFFECT.add(1);
-    }
   }),
 
   doAutocompleteSearch: function({ formOrigin, actionOrigin,
                                    searchString, previousResult,
                                    rect, requestId, remote }, target) {
     // Note: previousResult is a regular object, not an
     // nsIAutoCompleteResult.
     var result;
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -9265,22 +9265,16 @@
   },
   "PWMGR_BLOCKLIST_NUM_SITES": {
     "expires_in_version": "never",
     "kind": "exponential",
     "high": 100,
     "n_buckets" : 10,
     "description": "The number of sites for which the user has explicitly rejected saving logins"
   },
-  "PWMGR_FORM_ACTION_EFFECT": {
-    "expires_in_version": "never",
-    "kind": "enumerated",
-    "n_values" : 5,
-    "description": "The effect of the form action on signon autofill. (0=No effect, 1=Fewer logins after considering the form action, 2=No logins match form origin and action."
-  },
   "PWMGR_FORM_AUTOFILL_RESULT": {
     "expires_in_version": "never",
     "kind": "enumerated",
     "n_values" : 20,
     "description": "The result of auto-filling a login form. See http://mzl.la/1Mbs6jL for bucket descriptions."
   },
   "PWMGR_LOGIN_LAST_USED_DAYS": {
     "expires_in_version": "never",
--- a/toolkit/components/telemetry/histogram-whitelists.json
+++ b/toolkit/components/telemetry/histogram-whitelists.json
@@ -821,17 +821,16 @@
     "PREDICTOR_TOTAL_PRECONNECTS_UNUSED",
     "PREDICTOR_TOTAL_PRECONNECTS_USED",
     "PREDICTOR_TOTAL_PREDICTIONS",
     "PREDICTOR_TOTAL_PRERESOLVES",
     "PREDICTOR_WAIT_TIME",
     "PROCESS_CRASH_SUBMIT_ATTEMPT",
     "PROCESS_CRASH_SUBMIT_SUCCESS",
     "PWMGR_BLOCKLIST_NUM_SITES",
-    "PWMGR_FORM_ACTION_EFFECT",
     "PWMGR_FORM_AUTOFILL_RESULT",
     "PWMGR_LOGIN_LAST_USED_DAYS",
     "PWMGR_LOGIN_PAGE_SAFETY",
     "PWMGR_MANAGE_COPIED_PASSWORD",
     "PWMGR_MANAGE_COPIED_USERNAME",
     "PWMGR_MANAGE_DELETED",
     "PWMGR_MANAGE_DELETED_ALL",
     "PWMGR_MANAGE_OPENED",
@@ -2036,17 +2035,16 @@
     "PUSH_API_SUBSCRIBE_HTTP2_TIME",
     "PUSH_API_SUBSCRIBE_SUCCEEDED",
     "PUSH_API_SUBSCRIBE_WS_TIME",
     "PUSH_API_UNSUBSCRIBE_ATTEMPT",
     "PUSH_API_UNSUBSCRIBE_FAILED",
     "PUSH_API_UNSUBSCRIBE_SUCCEEDED",
     "PUSH_API_USED",
     "PWMGR_BLOCKLIST_NUM_SITES",
-    "PWMGR_FORM_ACTION_EFFECT",
     "PWMGR_FORM_AUTOFILL_RESULT",
     "PWMGR_LOGIN_LAST_USED_DAYS",
     "PWMGR_LOGIN_PAGE_SAFETY",
     "PWMGR_MANAGE_COPIED_PASSWORD",
     "PWMGR_MANAGE_COPIED_USERNAME",
     "PWMGR_MANAGE_DELETED",
     "PWMGR_MANAGE_DELETED_ALL",
     "PWMGR_MANAGE_OPENED",