Bug 1416141 - Remove Telemetry VIDEO_EME_PLAY_SUCCESS. r?kikuo draft
authorJames Cheng <jacheng@mozilla.com>
Fri, 10 Nov 2017 14:49:37 +0800
changeset 696129 b94351975abf34c5baa730edf99ea04bddf898b2
parent 696128 2877366beba847f2f48ff3a683b63e0abaaa14ae
child 739794 5a303f750944e43962890d295adcaf49cfc7c6ab
push id88645
push userbmo:jacheng@mozilla.com
push dateFri, 10 Nov 2017 07:59:43 +0000
reviewerskikuo
bugs1416141
milestone58.0a1
Bug 1416141 - Remove Telemetry VIDEO_EME_PLAY_SUCCESS. r?kikuo MozReview-Commit-ID: BtiD2tUmbE9
dom/html/HTMLMediaElement.cpp
dom/html/HTMLMediaElement.h
toolkit/components/telemetry/Histograms.json
toolkit/components/telemetry/histogram-whitelists.json
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -1732,22 +1732,16 @@ void HTMLMediaElement::ShutdownDecoder()
     mMediaSource->CompletePendingTransactions();
   }
   mDecoder->Shutdown();
   mDecoder = nullptr;
 }
 
 void HTMLMediaElement::AbortExistingLoads()
 {
-  // If there is no existing decoder then we don't have anything to
-  // report. This prevents reporting the initial load from an
-  // empty video element as a failed EME load.
-  if (mDecoder) {
-    ReportEMETelemetry();
-  }
   // Abort any already-running instance of the resource selection algorithm.
   mLoadWaitStatus = NOT_WAITING;
 
   // Set a new load ID. This will cause events which were enqueued
   // with a different load ID to silently be cancelled.
   mCurrentLoadID++;
 
   // Immediately reject or resolve the already-dispatched
@@ -4586,28 +4580,16 @@ void HTMLMediaElement::HiddenVideoStop()
   if (!mVideoDecodeSuspendTimer) {
     return;
   }
   mVideoDecodeSuspendTimer->Cancel();
   mVideoDecodeSuspendTimer = nullptr;
 }
 
 void
-HTMLMediaElement::ReportEMETelemetry()
-{
-  // Report telemetry for EME videos when a page is unloaded.
-  NS_ASSERTION(NS_IsMainThread(), "Should be on main thread.");
-  if (mIsEncrypted && Preferences::GetBool("media.eme.enabled")) {
-    Telemetry::Accumulate(Telemetry::VIDEO_EME_PLAY_SUCCESS, mLoadedDataFired);
-    LOG(LogLevel::Debug, ("%p VIDEO_EME_PLAY_SUCCESS = %s",
-                       this, mLoadedDataFired ? "true" : "false"));
-  }
-}
-
-void
 HTMLMediaElement::ReportTelemetry()
 {
   // Report telemetry for videos when a page is unloaded. We
   // want to know data on what state the video is at when
   // the user has exited.
   enum UnloadedState {
     ENDED = 0,
     PAUSED = 1,
@@ -6458,17 +6440,16 @@ void HTMLMediaElement::SuspendOrResumeEl
       this, aPauseElement, aSuspendEvents, OwnerDoc()->Hidden()));
 
   if (aPauseElement != mPausedForInactiveDocumentOrChannel) {
     mPausedForInactiveDocumentOrChannel = aPauseElement;
     UpdateSrcMediaStreamPlaying();
     UpdateAudioChannelPlayingState();
     if (aPauseElement) {
       ReportTelemetry();
-      ReportEMETelemetry();
 
       // For EME content, we may force destruction of the CDM client (and CDM
       // instance if this is the last client for that CDM instance) and
       // the CDM's decoder. This ensures the CDM gets reliable and prompt
       // shutdown notifications, as it may have book-keeping it needs
       // to do on shutdown.
       if (mMediaKeys) {
         nsAutoString keySystem;
--- a/dom/html/HTMLMediaElement.h
+++ b/dom/html/HTMLMediaElement.h
@@ -1236,18 +1236,16 @@ protected:
    */
   void HiddenVideoStart();
   /**
    * Video is not playing anymore and/or has become visible.
    * Used to track hidden-video telemetry.
    */
   void HiddenVideoStop();
 
-  void ReportEMETelemetry();
-
   void ReportTelemetry();
 
   // Seeks to aTime seconds. aSeekType can be Exact to seek to exactly the
   // seek target, or PrevSyncPoint if a quicker but less precise seek is
   // desired, and we'll seek to the sync point (keyframe and/or start of the
   // next block of audio samples) preceeding seek target.
   already_AddRefed<Promise> Seek(double aTime, SeekTarget::Type aSeekType, ErrorResult& aRv);
 
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -11507,22 +11507,16 @@
   "DATA_STORAGE_ENTRIES": {
     "record_in_processes": ["main", "content"],
     "expires_in_version": "default",
     "kind": "linear",
     "high": 1024,
     "n_buckets": 16,
     "description": "The number of entries in persistent DataStorage (HSTS and HPKP data, basically)"
   },
-  "VIDEO_EME_PLAY_SUCCESS": {
-    "record_in_processes": ["main", "content"],
-    "expires_in_version": "45",
-    "kind": "boolean",
-    "description": "EME video playback success or failure"
-  },
   "VIDEO_PLAY_TIME_MS" : {
     "record_in_processes": ["main", "content"],
     "alert_emails": ["ajones@mozilla.com"],
     "expires_in_version": "60",
     "description": "Total time spent playing video in milliseconds. This reports the total play time for an HTML Media Element whenever it is suspended or resumed, such as when the page is unloaded, or when the mute status changes when the AudioChannelAPI pref is set.",
     "kind": "exponential",
     "high": 7200000,
     "n_buckets": 100,
--- a/toolkit/components/telemetry/histogram-whitelists.json
+++ b/toolkit/components/telemetry/histogram-whitelists.json
@@ -548,17 +548,16 @@
     "TRANSLATION_OPPORTUNITIES",
     "TRANSLATION_OPPORTUNITIES_BY_LANGUAGE",
     "VIDEO_CANPLAYTYPE_H264_CONSTRAINT_SET_FLAG",
     "VIDEO_CANPLAYTYPE_H264_LEVEL",
     "VIDEO_CANPLAYTYPE_H264_PROFILE",
     "VIDEO_DECODED_H264_SPS_CONSTRAINT_SET_FLAG",
     "VIDEO_DECODED_H264_SPS_LEVEL",
     "VIDEO_DECODED_H264_SPS_PROFILE",
-    "VIDEO_EME_PLAY_SUCCESS",
     "VIDEO_H264_SPS_MAX_NUM_REF_FRAMES",
     "WEAVE_COMPLETE_SUCCESS_COUNT",
     "WEAVE_CONFIGURED",
     "WEAVE_CONFIGURED_MASTER_PASSWORD",
     "WEAVE_START_COUNT",
     "WEBCRYPTO_ALG",
     "WEBCRYPTO_EXTRACTABLE_ENC",
     "WEBCRYPTO_EXTRACTABLE_GENERATE",
@@ -1406,17 +1405,16 @@
     "VIDEO_CANPLAYTYPE_H264_CONSTRAINT_SET_FLAG",
     "VIDEO_CANPLAYTYPE_H264_LEVEL",
     "VIDEO_CANPLAYTYPE_H264_PROFILE",
     "VIDEO_CAN_CREATE_AAC_DECODER",
     "VIDEO_CAN_CREATE_H264_DECODER",
     "VIDEO_DECODED_H264_SPS_CONSTRAINT_SET_FLAG",
     "VIDEO_DECODED_H264_SPS_LEVEL",
     "VIDEO_DECODED_H264_SPS_PROFILE",
-    "VIDEO_EME_PLAY_SUCCESS",
     "VIDEO_EME_REQUEST_FAILURE_LATENCY_MS",
     "VIDEO_EME_REQUEST_SUCCESS_LATENCY_MS",
     "VIDEO_H264_SPS_MAX_NUM_REF_FRAMES",
     "VIEW_SOURCE_EXTERNAL_RESULT_BOOLEAN",
     "VIEW_SOURCE_IN_BROWSER_OPENED_BOOLEAN",
     "VIEW_SOURCE_IN_WINDOW_OPENED_BOOLEAN",
     "WEAVE_COMPLETE_SUCCESS_COUNT",
     "WEAVE_CONFIGURED",