Bug 1386959 - [Form Autofill] Add probe for form autofill availability. r=francois, r=lchang, a=gchang
authorsteveck-chung <schung@mozilla.com>
Mon, 14 Aug 2017 11:56:19 +0800
changeset 423815 72f3e9b7c6ea3cbd5edf816ef3a30c3f5595a219
parent 423814 c23f9c735d299160f9df8d2a5ab0838562f4e013
child 423816 6562cd359748066a9733b8aafe017097985f5006
push id1517
push userjlorenzo@mozilla.com
push dateThu, 14 Sep 2017 16:50:54 +0000
treeherdermozilla-release@3b41fd564418 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfrancois, lchang, gchang
bugs1386959
milestone56.0
Bug 1386959 - [Form Autofill] Add probe for form autofill availability. r=francois, r=lchang, a=gchang MozReview-Commit-ID: KPOBxmHOiuK
browser/extensions/formautofill/bootstrap.js
toolkit/components/telemetry/Scalars.yaml
--- a/browser/extensions/formautofill/bootstrap.js
+++ b/browser/extensions/formautofill/bootstrap.js
@@ -63,16 +63,17 @@ function isAvailable() {
 }
 
 function startup(data) {
   if (!isAvailable()) {
     Services.prefs.clearUserPref("dom.forms.autocomplete.formautofill");
     // reset the sync related prefs incase the feature was previously available
     // but isn't now.
     Services.prefs.clearUserPref("services.sync.engine.addresses.available");
+    Services.telemetry.scalarSet("formautofill.availability", false);
     return;
   }
 
   if (data.hasOwnProperty("instanceID") && data.instanceID) {
     if (AddonManagerPrivate.isDBLoaded()) {
       addUpgradeListener(data.instanceID);
     } else {
       // Wait for the extension database to be loaded so we don't cause its init.
@@ -84,16 +85,17 @@ function startup(data) {
   } else {
     throw Error("no instanceID passed to bootstrap startup");
   }
 
   // This pref is used for web contents to detect the autocomplete feature.
   // When it's true, "element.autocomplete" will return tokens we currently
   // support -- otherwise it'll return an empty string.
   Services.prefs.setBoolPref("dom.forms.autocomplete.formautofill", true);
+  Services.telemetry.scalarSet("formautofill.availability", true);
 
   // This pref determines whether the "addresses" sync engine is available
   // (ie, whether it is shown in any UI etc) - it *does not* determine whether
   // the engine is actually enabled or not.
   Services.prefs.setBoolPref("services.sync.engine.addresses.available", true);
 
   // Listen for the autocomplete popup message to lazily append our stylesheet related to the popup.
   Services.mm.addMessageListener("FormAutoComplete:MaybeOpenPopup", onMaybeOpenPopup);
--- a/toolkit/components/telemetry/Scalars.yaml
+++ b/toolkit/components/telemetry/Scalars.yaml
@@ -765,16 +765,31 @@ gfx.advanced.layers:
     kind: uint
     expires: "61"
     notification_emails:
       - gfx-telemetry-alerts@mozilla.com
     record_in_processes:
       - 'main'
 
 # The following section contains the form autofill related scalars.
+formautofill:
+  availability:
+    bug_numbers:
+      - 1386959
+    description: A boolean sent once per session to represent whether the formautofill is available in the build
+    expires: never
+    kind: boolean
+    notification_emails:
+      - autofill@lists.mozilla.org
+      - jcheng@mozilla.com
+      - chsiang@mozilla.com
+    release_channel_collection: opt-out
+    record_in_processes:
+      - 'main'
+
 formautofill.addresses:
   fill_type_manual:
     bug_numbers:
       - 990200
     description: Count at submission time whether the submitted form was filled manually.
     expires: never
     kind: uint
     notification_emails: