Bug 1252168 - Don't send CDM unsupported notifications from Gecko to chrome. r=kentuckyfriedtakahe
authorChris Pearce <cpearce@mozilla.com>
Thu, 03 Mar 2016 11:02:17 +1300
changeset 322906 3511cf3b224219d96cbb851e3ef903c92627b836
parent 322905 e4f7da85ded27a18df9ea0726cf652be9f302fb4
child 322907 23d04ebb17cf8a0f0153682627140f87de6b30ff
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskentuckyfriedtakahe
bugs1252168
milestone47.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 1252168 - Don't send CDM unsupported notifications from Gecko to chrome. r=kentuckyfriedtakahe MozReview-Commit-ID: FDfpeEt3HfT
dom/media/eme/MediaKeySystemAccess.cpp
dom/media/test/test_eme_request_notifications.html
--- a/dom/media/eme/MediaKeySystemAccess.cpp
+++ b/dom/media/eme/MediaKeySystemAccess.cpp
@@ -572,16 +572,22 @@ MediaKeySystemAccess::GetSupportedConfig
 
 
 /* static */
 void
 MediaKeySystemAccess::NotifyObservers(nsPIDOMWindowInner* aWindow,
                                       const nsAString& aKeySystem,
                                       MediaKeySystemStatus aStatus)
 {
+  if (aStatus == MediaKeySystemStatus::Cdm_not_supported) {
+    // Ignore, since there's nothing the user can do to rectify this, and we
+    // don't want the prompt to confuse them.
+    // TODO: Remove places that call with this entirely.
+    return;
+  }
   RequestMediaKeySystemAccessNotification data;
   data.mKeySystem = aKeySystem;
   data.mStatus = aStatus;
   nsAutoString json;
   data.ToJSON(json);
   EME_LOG("MediaKeySystemAccess::NotifyObservers() %s", NS_ConvertUTF16toUTF8(json).get());
   nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
   if (obs) {
--- a/dom/media/test/test_eme_request_notifications.html
+++ b/dom/media/test/test_eme_request_notifications.html
@@ -70,21 +70,16 @@ var tests = [
   },
   {
     keySystem: CLEARKEY_ID,
     shouldPass: false,
     expectedStatus: 'cdm-disabled',
     prefs: [["media.eme.enabled", true], ["media.eme.clearkey.enabled", false]]
   },
   {
-    keySystem: 'unsupported-keysystem',
-    shouldPass: false,
-    expectedStatus: 'cdm-not-supported'
-  },
-  {
     keySystem: CLEARKEY_ID + '.10000' , // A stupendously high min CDM version, presumably not installed.
     shouldPass: false,
     expectedStatus: 'cdm-insufficient-version',
     prefs: [["media.eme.enabled", true], ["media.eme.clearkey.enabled", true]]
   },
   {
     keySystem: CLEARKEY_ID,
     shouldPass: true,