Bug 1283630 - Remove remaining MOZ_WIDEVINE_EME define checks. r=jwwang
authorChris Pearce <cpearce@mozilla.com>
Fri, 01 Jul 2016 09:39:48 +1200
changeset 383053 2bca7bc98f9868885f92772f9d5d1c818fbb195b
parent 383052 8836868dd1e569fb075c32c5152782f18bf253cc
child 383054 1e32d001ffbe6bc88bf8539f1ff258c526fd9326
push id21910
push userbmo:gasolin@mozilla.com
push dateFri, 01 Jul 2016 03:50:27 +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
@@ -389,17 +389,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) {
@@ -531,20 +531,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,
@@ -587,17 +584,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(