Backed out changeset 1fe86d8df2cd (bug 1341569) for eslint failure at browser/extensions/formautofill/FormAutofillHandler.jsm:666: Missing trailing comma. r=backout
authorSebastian Hengst <archaeopteryx@coole-files.de>
Fri, 08 Sep 2017 15:02:02 +0200
changeset 429200 6bbc9cb736d0256d94ad13c593e14f885539bb10
parent 429199 915065b1b334373c68e36f583ca35ee7855e05ae
child 429201 6af4edb9979ef0c3f2d6ae9fe0afc9249d34c32c
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1341569
milestone57.0a1
backs out1fe86d8df2cd7172c66b0506bf0b0e789e86cf01
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
Backed out changeset 1fe86d8df2cd (bug 1341569) for eslint failure at browser/extensions/formautofill/FormAutofillHandler.jsm:666: Missing trailing comma. r=backout
browser/extensions/formautofill/FormAutofillContent.jsm
browser/extensions/formautofill/FormAutofillHandler.jsm
browser/extensions/formautofill/FormAutofillParent.jsm
toolkit/components/telemetry/Histograms.json
--- a/browser/extensions/formautofill/FormAutofillContent.jsm
+++ b/browser/extensions/formautofill/FormAutofillContent.jsm
@@ -367,22 +367,20 @@ var FormAutofillContent = {
       Services.cpmm.initialProcessData.autofillSavedFieldNames;
   },
 
   /**
    * Send the profile to parent for doorhanger and storage saving/updating.
    *
    * @param {Object} profile Submitted form's address/creditcard guid and record.
    * @param {Object} domWin Current content window.
-   * @param {int} timeStartedFillingMS Time of form filling started.
    */
-  _onFormSubmit(profile, domWin, timeStartedFillingMS) {
+  _onFormSubmit(profile, domWin) {
     let mm = this._messageManagerFromWindow(domWin);
-    mm.sendAsyncMessage("FormAutofill:OnFormSubmit",
-                        {profile, timeStartedFillingMS});
+    mm.sendAsyncMessage("FormAutofill:OnFormSubmit", profile);
   },
 
   /**
    * Handle earlyformsubmit event and early return when:
    * 1. In private browsing mode.
    * 2. Could not map any autofill handler by form element.
    * 3. Number of filled fields is less than autofill threshold
    *
@@ -404,17 +402,17 @@ var FormAutofillContent = {
       return true;
     }
 
     let records = handler.createRecords();
     if (!Object.keys(records).length) {
       return true;
     }
 
-    this._onFormSubmit(records, domWin, handler.timeStartedFillingMS);
+    this._onFormSubmit(records, domWin);
     return true;
   },
 
   receiveMessage({name, data}) {
     switch (name) {
       case "FormAutofill:enabledStatus": {
         if (data) {
           ProfileAutocomplete.ensureRegistered();
--- a/browser/extensions/formautofill/FormAutofillHandler.jsm
+++ b/browser/extensions/formautofill/FormAutofillHandler.jsm
@@ -116,21 +116,16 @@ FormAutofillHandler.prototype = {
     // When the number of form controls is the same with last collection, it
     // can be recognized as there is no element changed. However, we should
     // improve the function to detect the element changes. e.g. a tel field
     // is changed from type="hidden" to type="tel".
     return this._formFieldCount != this.form.elements.length;
   },
 
   /**
-   * Time in milliseconds since epoch when a user started filling in the form.
-   */
-  timeStartedFillingMS: null,
-
-  /**
    * Set fieldDetails from the form about fields that can be autofilled.
    *
    * @param {boolean} allowDuplicates
    *        true to remain any duplicated field details otherwise to remove the
    *        duplicated ones.
    * @returns {Array} The valid address and credit card details.
    */
   collectFormFields(allowDuplicates = false) {
@@ -153,27 +148,19 @@ FormAutofillHandler.prototype = {
                 "field(s)");
       this.address.fieldDetails = [];
     }
 
     if (!this.creditCard.fieldDetails.some(i => i.fieldName == "cc-number")) {
       log.debug("Ignoring credit card related fields since it's without credit card number field");
       this.creditCard.fieldDetails = [];
     }
-    let validDetails = Array.of(...(this.address.fieldDetails),
-                                ...(this.creditCard.fieldDetails));
-    for (let detail of validDetails) {
-      let input = detail.elementWeakRef.get();
-      if (!input) {
-        continue;
-      }
-      input.addEventListener("input", this);
-    }
 
-    return validDetails;
+    return Array.of(...(this.address.fieldDetails),
+                    ...(this.creditCard.fieldDetails));
   },
 
   getFieldDetailByName(fieldName) {
     return this.fieldDetails.find(detail => detail.fieldName == fieldName);
   },
 
   getFieldDetailsByElement(element) {
     let fieldDetail = this.fieldDetails.find(
@@ -640,28 +627,9 @@ FormAutofillHandler.prototype = {
       Services.cpmm.addMessageListener("FormAutofill:DecryptedString", function getResult(result) {
         Services.cpmm.removeMessageListener("FormAutofill:DecryptedString", getResult);
         resolve(result.data);
       });
 
       Services.cpmm.sendAsyncMessage("FormAutofill:GetDecryptedString", {cipherText, reauth});
     });
   },
-
-  handleEvent(event) {
-    switch (event.type) {
-      case "input":
-        if (!event.isTrusted) {
-          return;
-        }
-
-        for (let detail of this.fieldDetails) {
-          let input = detail.elementWeakRef.get();
-          if (!input) {
-            continue;
-          }
-          input.removeEventListener("input", this);
-        }
-        this.timeStartedFillingMS = Date.now();
-        break;
-    }
-  }
 };
--- a/browser/extensions/formautofill/FormAutofillParent.jsm
+++ b/browser/extensions/formautofill/FormAutofillParent.jsm
@@ -344,29 +344,27 @@ FormAutofillParent.prototype = {
       Services.ppmm.initialProcessData.autofillSavedFieldNames.delete(fieldName);
     });
 
     Services.ppmm.broadcastAsyncMessage("FormAutofill:savedFieldNames",
                                         Services.ppmm.initialProcessData.autofillSavedFieldNames);
     this._updateStatus();
   },
 
-  _onAddressSubmit(address, target, timeStartedFillingMS) {
+  _onAddressSubmit(address, target) {
     if (address.guid) {
       // Avoid updating the fields that users don't modify.
       let originalAddress = this.profileStorage.addresses.get(address.guid);
       for (let field in address.record) {
         if (address.untouchedFields.includes(field) && originalAddress[field]) {
           address.record[field] = originalAddress[field];
         }
       }
 
       if (!this.profileStorage.addresses.mergeIfPossible(address.guid, address.record)) {
-        this._recordFormFillingTime("address", "autofill-update", timeStartedFillingMS);
-
         FormAutofillDoorhanger.show(target, "update").then((state) => {
           let changedGUIDs = this.profileStorage.addresses.mergeToStorage(address.record);
           switch (state) {
             case "create":
               if (!changedGUIDs.length) {
                 changedGUIDs.push(this.profileStorage.addresses.add(address.record));
               }
               break;
@@ -380,27 +378,25 @@ FormAutofillParent.prototype = {
               break;
           }
           changedGUIDs.forEach(guid => this.profileStorage.addresses.notifyUsed(guid));
         });
         // Address should be updated
         Services.telemetry.scalarAdd("formautofill.addresses.fill_type_autofill_update", 1);
         return;
       }
-      this._recordFormFillingTime("address", "autofill", timeStartedFillingMS);
       this.profileStorage.addresses.notifyUsed(address.guid);
       // Address is merged successfully
       Services.telemetry.scalarAdd("formautofill.addresses.fill_type_autofill", 1);
     } else {
       let changedGUIDs = this.profileStorage.addresses.mergeToStorage(address.record);
       if (!changedGUIDs.length) {
         changedGUIDs.push(this.profileStorage.addresses.add(address.record));
       }
       changedGUIDs.forEach(guid => this.profileStorage.addresses.notifyUsed(guid));
-      this._recordFormFillingTime("address", "manual", timeStartedFillingMS);
 
       // Show first time use doorhanger
       if (Services.prefs.getBoolPref("extensions.formautofill.firstTimeUse")) {
         Services.prefs.setBoolPref("extensions.formautofill.firstTimeUse", false);
         FormAutofillDoorhanger.show(target, "firstTimeUse").then((state) => {
           if (state !== "open-pref") {
             return;
           }
@@ -441,33 +437,18 @@ FormAutofillParent.prototype = {
       return;
     }
 
     await this.profileStorage.creditCards.normalizeCCNumberFields(creditCard.record);
     this.profileStorage.creditCards.add(creditCard.record);
   },
 
   _onFormSubmit(data, target) {
-    let {profile: {address, creditCard}, timeStartedFillingMS} = data;
+    let {address, creditCard} = data;
 
     if (address) {
-      this._onAddressSubmit(address, target, timeStartedFillingMS);
+      this._onAddressSubmit(address, target);
     }
     if (creditCard) {
       this._onCreditCardSubmit(creditCard, target);
     }
   },
-  /**
-   * Set the probes for the filling time with specific filling type and form type.
-   *
-   * @private
-   * @param  {string} formType
-   *         3 type of form (address/creditcard/address-creditcard).
-   * @param  {string} fillingType
-   *         3 filling type (manual/autofill/autofill-update).
-   * @param  {int} startedFillingMS
-   *         Time that form started to filling in ms.
-   */
-  _recordFormFillingTime(formType, fillingType, startedFillingMS) {
-    let histogram = Services.telemetry.getKeyedHistogramById("FORM_FILLING_REQUIRED_TIME_MS");
-    histogram.add(`${formType}-${fillingType}`, Date.now() - startedFillingMS);
-  },
 };
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -13638,21 +13638,10 @@
     "alert_emails": ["ajones@mozilla.com", "bwu@mozilla.com", "tkuo@mozilla.com"],
     "expires_in_version": "60",
     "releaseChannelCollection": "opt-out",
     "kind": "exponential",
     "high": 64000,
     "n_buckets": 100,
     "bug_numbers": [1393399],
     "description": "Time in milliseconds to recover a video decoder from a HW video decoder crash, calculated since MFR gets a NS_ERROR_DOM_MEDIA_NEED_NEW_DECODER error. The data is sent when video decoding is recovered from a GPU crash and the first frame is decoded."
-  },
-  "FORM_FILLING_REQUIRED_TIME_MS": {
-    "record_in_processes": ["main"],
-    "alert_emails": ["autofill@lists.mozilla.org", "jcheng@mozilla.com", "chsiang@mozilla.com"],
-    "expires_in_version": "60",
-    "kind": "exponential",
-    "high": 300000,
-    "n_buckets": 22,
-    "keyed": true,
-    "bug_numbers": [1341569],
-    "description": "Milliseconds between starting to fill an autofill-eligible form field and submitting the form, keyed by the combination of form type and filling type."
   }
 }