Bug 1112189 - Additional telemetry for tracking protection shield. r=mfinkle
authorMargaret Leibovic <margaret.leibovic@gmail.com>
Wed, 17 Dec 2014 17:30:38 -0800
changeset 220341 75e9894b3028df78f2f9b3d9f9b129e0172e2f21
parent 220340 95f5bf0187065e44c07bc66171fe685b4ac40759
child 220342 86b156ead17eccfad68773c7004ee73e4330a74b
push id10474
push usermleibovic@mozilla.com
push dateThu, 18 Dec 2014 17:55:49 +0000
treeherderfx-team@75e9894b3028 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs1112189
milestone37.0a1
Bug 1112189 - Additional telemetry for tracking protection shield. r=mfinkle
mobile/android/chrome/content/browser.js
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -344,16 +344,18 @@ var BrowserApp = {
 #ifdef MOZ_SAFE_BROWSING
         Services.tm.mainThread.dispatch(function() {
           // Bug 778855 - Perf regression if we do this here. To be addressed in bug 779008.
           SafeBrowsing.init();
         }, Ci.nsIThread.DISPATCH_NORMAL);
 #endif
 #ifdef NIGHTLY_BUILD
         WebcompatReporter.init();
+        Telemetry.addData("TRACKING_PROTECTION_ENABLED",
+          Services.prefs.getBoolPref("privacy.trackingprotection.enabled"));
 #endif
       } catch(ex) { console.log(ex); }
     }, false);
 
     BrowserEventHandler.init();
     ViewportHandler.init();
 
     Services.androidBridge.browserApp = this;
@@ -6783,25 +6785,28 @@ var IdentityHandler = {
       return this.MIXED_MODE_CONTENT_LOADED;
     }
 
     return this.MIXED_MODE_UNKNOWN;
   },
 
   getTrackingMode: function getTrackingMode(aState) {
     if (aState & Ci.nsIWebProgressListener.STATE_BLOCKED_TRACKING_CONTENT) {
+      Telemetry.addData("TRACKING_PROTECTION_SHIELD", 2);
       return this.TRACKING_MODE_CONTENT_BLOCKED;
     }
 
     // Only show an indicator for loaded tracking content if the pref to block it is enabled
     if ((aState & Ci.nsIWebProgressListener.STATE_LOADED_TRACKING_CONTENT) &&
          Services.prefs.getBoolPref("privacy.trackingprotection.enabled")) {
+      Telemetry.addData("TRACKING_PROTECTION_SHIELD", 1);
       return this.TRACKING_MODE_CONTENT_LOADED;
     }
 
+    Telemetry.addData("TRACKING_PROTECTION_SHIELD", 0);
     return this.TRACKING_MODE_UNKNOWN;
   },
 
   /**
    * Determine the identity of the page being displayed by examining its SSL cert
    * (if available). Return the data needed to update the UI.
    */
   checkIdentity: function checkIdentity(aState, aBrowser) {