Bug 1229971 - Change name and logic of youtube embed telemetry probe; r=vladan, r=cpeterson
authorKyle Machulis <kyle@nonpolynomial.com>
Mon, 07 Dec 2015 15:36:47 -0800
changeset 275933 266672b18676c699247a6d828558a2c075604b8c
parent 275932 67aea49920bc30e931b0f27fbdffc88218d32265
child 275934 cc52b64c6eeeda808d0c27b9430ade9d50abb636
push id29776
push usercbook@mozilla.com
push dateWed, 09 Dec 2015 11:02:31 +0000
treeherdermozilla-central@319be5e7ce30 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvladan, cpeterson
bugs1229971
milestone45.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 1229971 - Change name and logic of youtube embed telemetry probe; r=vladan, r=cpeterson
dom/base/nsObjectLoadingContent.cpp
toolkit/components/telemetry/Histograms.json
--- a/dom/base/nsObjectLoadingContent.cpp
+++ b/dom/base/nsObjectLoadingContent.cpp
@@ -1498,17 +1498,18 @@ nsObjectLoadingContent::IsYoutubeEmbed()
   // See if URL is referencing youtube
   nsAutoCString domain("youtube.com");
   if (!StringEndsWith(domain, currentBaseDomain)) {
     return false;
   }
   // See if requester is planning on using the JS API.
   nsAutoCString uri;
   mURI->GetSpec(uri);
-  if (uri.Find("enablejsapi=1", true, 0, -1) == kNotFound) {
+  // Only log urls that are rewritable, e.g. not using enablejsapi=1
+  if (uri.Find("enablejsapi=1", true, 0, -1) != kNotFound) {
     return false;
   }
   return true;
 }
 
 bool
 nsObjectLoadingContent::CheckLoadPolicy(int16_t *aContentPolicy)
 {
@@ -2155,17 +2156,17 @@ nsObjectLoadingContent::LoadObject(bool 
     // when the channel has just opened -- in which case this call should
     // have originated from OnStartRequest
     NS_NOTREACHED("Loading with a channel, but state doesn't make sense");
     return NS_OK;
   }
 
   // Check whether this is a youtube embed.
   if (IsYoutubeEmbed()) {
-    Telemetry::Accumulate(Telemetry::YOUTUBE_EMBED_SEEN, 1);
+    Telemetry::Accumulate(Telemetry::YOUTUBE_REWRITABLE_EMBED_SEEN, 1);
   }
 
   //
   // Security checks
   //
 
   if (mType != eType_Null) {
     bool allowLoad = true;
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -10055,22 +10055,16 @@
   "PLUGIN_ACTIVATION_COUNT": {
     "alert_emails": ["cpeterson@mozilla.com"],
     "expires_in_version": "48",
     "kind": "count",
     "keyed": true,
     "releaseChannelCollection": "opt-out",
     "description": "Counts number of times a certain plugin has been activated."
   },
-  "YOUTUBE_EMBED_SEEN": {
-    "alert_emails": ["cpeterson@mozilla.com"],
-    "expires_in_version": "48",
-    "kind": "flag",
-    "description": "Flag activated whenever a youtube flash embed is seen during a session."
-  },
   "WEB_NOTIFICATION_CLICKED": {
     "alert_emails": ["firefox-dev@mozilla.org"],
     "bug_numbers": [1225336],
     "expires_in_version": "50",
     "kind": "count",
     "description": "Count of times a web notification was clicked"
   },
   "WEB_NOTIFICATION_MENU": {
@@ -10159,10 +10153,17 @@
     "description": "Compression ratio of WOFF2 data (%)"
   },
   "WEBRTC_ICE_CHECKING_RATE": {
     "alert_emails": ["webrtc-ice-telemetry-alerts@mozilla.com"],
     "expires_in_version": "53",
     "kind": "boolean",
     "bug_numbers": [1188391],
     "description": "The number of ICE connections which immediately failed (0) vs. reached at least checking state (1)."
+  },
+  "YOUTUBE_REWRITABLE_EMBED_SEEN": {
+    "alert_emails": ["cpeterson@mozilla.com"],
+    "expires_in_version": "48",
+    "kind": "flag",
+    "bug_numbers": [1229971],
+    "description": "Flag activated whenever a rewritable youtube flash embed is seen during a session."
   }
 }