Backed out changeset 1fe86d8df2cd (bug 1341569) for eslint failure at browser/extensions/formautofill/FormAutofillHandler.jsm:666: Missing trailing comma. r=backout

This commit is contained in:
Sebastian Hengst 2017-09-08 15:02:02 +02:00
Родитель 4b361e3a21
Коммит 807d7fc2da
4 изменённых файлов: 8 добавлений и 72 удалений

Просмотреть файл

@ -372,12 +372,10 @@ var FormAutofillContent = {
*
* @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);
},
/**
@ -409,7 +407,7 @@ var FormAutofillContent = {
return true;
}
this._onFormSubmit(records, domWin, handler.timeStartedFillingMS);
this._onFormSubmit(records, domWin);
return true;
},

Просмотреть файл

@ -120,11 +120,6 @@ FormAutofillHandler.prototype = {
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.
*
@ -158,17 +153,9 @@ FormAutofillHandler.prototype = {
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) {
@ -645,23 +632,4 @@ FormAutofillHandler.prototype = {
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;
}
}
};

Просмотреть файл

@ -349,7 +349,7 @@ FormAutofillParent.prototype = {
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);
@ -360,8 +360,6 @@ FormAutofillParent.prototype = {
}
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) {
@ -385,7 +383,6 @@ FormAutofillParent.prototype = {
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);
@ -395,7 +392,6 @@ FormAutofillParent.prototype = {
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")) {
@ -446,28 +442,13 @@ FormAutofillParent.prototype = {
},
_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);
},
};

Просмотреть файл

@ -13643,16 +13643,5 @@
"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."
}
}