Bug 1283630 - Remove remaining MOZ_WIDEVINE_EME define checks. r?jwwang draft
authorChris Pearce <cpearce@mozilla.com>
Fri, 01 Jul 2016 09:39:48 +1200
changeset 382934 14d28d9c1f1b2ba6b61abfd55e7f91768402b229
parent 381966 e45890951ce77c3df05575bd54072b9f300d77b0
child 524342 2afebc7591c4892bb2cb2d02a3b4a76cc5b90aae
push id21879
push usercpearce@mozilla.com
push dateThu, 30 Jun 2016 21:41:23 +0000
reviewersjwwang
bugs1283630, 1276132
milestone50.0a1
Bug 1283630 - Remove remaining MOZ_WIDEVINE_EME define checks. r?jwwang I had meant to remove all of these in bug 1276132, but I missed a couple. We should now check whether Widevine is enabled before hitting these code paths by checking the preference. MozReview-Commit-ID: FmAdlgbF0Py
dom/media/eme/MediaKeySystemAccess.cpp
--- a/dom/media/eme/MediaKeySystemAccess.cpp
+++ b/dom/media/eme/MediaKeySystemAccess.cpp
@@ -388,17 +388,17 @@ GMPDecryptsAndGeckoDecodesAAC(mozIGeckoM
 
   if (HaveGMPFor(aGMPService,
     NS_ConvertUTF16toUTF8(aKeySystem),
     NS_LITERAL_CSTRING(GMP_API_AUDIO_DECODER),
     NS_LITERAL_CSTRING("aac"))) {
     // We do have a GMP for AAC -> Gecko itself does *not* decode AAC.
     return false;
   }
-#if defined(MOZ_WIDEVINE_EME) && defined(XP_WIN)
+#if defined(XP_WIN)
   // Widevine CDM doesn't include an AAC decoder. So if WMF can't
   // decode AAC, and a codec wasn't specified, be conservative
   // and reject the MediaKeys request, since our policy is to prevent
   //  the Adobe GMP's unencrypted AAC decoding path being used to
   // decode content decrypted by the Widevine CDM.
   if (aKeySystem.EqualsLiteral("com.widevine.alpha") &&
       !WMFDecoderModule::HasAAC()) {
     if (aDiagnostics) {
@@ -465,20 +465,17 @@ IsSupported(mozIGeckoMediaPluginService*
 
 static bool
 IsSupportedInitDataType(const nsString& aCandidate, const nsAString& aKeySystem)
 {
   // All supported keySystems can handle "cenc" initDataType.
   // ClearKey also supports "keyids" and "webm" initDataTypes.
   return aCandidate.EqualsLiteral("cenc") ||
     ((aKeySystem.EqualsLiteral("org.w3.clearkey")
-#ifdef MOZ_WIDEVINE_EME
-    || aKeySystem.EqualsLiteral("com.widevine.alpha")
-#endif
-    ) &&
+    || aKeySystem.EqualsLiteral("com.widevine.alpha")) &&
     (aCandidate.EqualsLiteral("keyids") || aCandidate.EqualsLiteral("webm)")));
 }
 
 static bool
 GetSupportedConfig(mozIGeckoMediaPluginService* aGMPService,
                    const nsAString& aKeySystem,
                    const MediaKeySystemConfiguration& aCandidate,
                    MediaKeySystemConfiguration& aOutConfig,
@@ -521,17 +518,17 @@ GetSupportedConfig(mozIGeckoMediaPluginS
     }
     if (caps.IsEmpty()) {
       return false;
     }
     config.mVideoCapabilities.Construct();
     config.mVideoCapabilities.Value().Assign(caps);
   }
 
-#if defined(MOZ_WIDEVINE_EME) && defined(XP_WIN)
+#if defined(XP_WIN)
   // Widevine CDM doesn't include an AAC decoder. So if WMF can't decode AAC,
   // and a codec wasn't specified, be conservative and reject the MediaKeys request.
   if (aKeySystem.EqualsLiteral("com.widevine.alpha") &&
       (!aCandidate.mAudioCapabilities.WasPassed() ||
        !aCandidate.mVideoCapabilities.WasPassed()) &&
      !WMFDecoderModule::HasAAC()) {
     if (aDiagnostics) {
       aDiagnostics->SetKeySystemIssue(