Bug 1180610 - Handle EME plugin voucher disappearing after installation before restart. r=jw_wang, a=lmandel
authorChris Pearce <cpearce@mozilla.com>
Mon, 06 Jul 2015 21:59:07 +1200
changeset 275268 53763147728beeddb978cc74ca499adde0514efc
parent 275267 8f7c8943ffe72f021183a26c6488d60a915249cc
child 275273 2ee2f2de65ded6acb4cf7f56379062fd6da84924
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjw_wang, lmandel
bugs1180610
milestone40.0
Bug 1180610 - Handle EME plugin voucher disappearing after installation before restart. r=jw_wang, a=lmandel
dom/media/eme/MediaKeySystemAccess.cpp
--- a/dom/media/eme/MediaKeySystemAccess.cpp
+++ b/dom/media/eme/MediaKeySystemAccess.cpp
@@ -160,26 +160,16 @@ EnsureMinCDMVersion(mozIGeckoMediaPlugin
                                                      versionStr)))) {
     return MediaKeySystemStatus::Error;
   }
 
   if (!hasPlugin) {
     return MediaKeySystemStatus::Cdm_not_installed;
   }
 
-  if (aMinCdmVersion == NO_CDM_VERSION) {
-    return MediaKeySystemStatus::Available;
-  }
-
-  nsresult rv;
-  int32_t version = versionStr.ToInteger(&rv);
-  if (NS_FAILED(rv) || version < 0 || aMinCdmVersion > version) {
-    return MediaKeySystemStatus::Cdm_insufficient_version;
-  }
-
 #ifdef XP_WIN
   if (aKeySystem.EqualsLiteral("com.adobe.access") ||
       aKeySystem.EqualsLiteral("com.adobe.primetime")) {
     // Verify that anti-virus hasn't "helpfully" deleted the Adobe GMP DLL,
     // as we suspect may happen (Bug 1160382).
     if (!AdobePluginDLLExists(versionStr) ||
         !AdobePluginVoucherExists(versionStr)) {
       NS_WARNING("Adobe EME plugin or voucher disappeared from disk!");
@@ -187,16 +177,23 @@ EnsureMinCDMVersion(mozIGeckoMediaPlugin
       // Firefox will try to download the plugin next time the updater runs.
       Preferences::ClearUser("media.gmp-eme-adobe.lastUpdate");
       Preferences::ClearUser("media.gmp-eme-adobe.version");
       return MediaKeySystemStatus::Cdm_not_installed;
     }
   }
 #endif
 
+  nsresult rv;
+  int32_t version = versionStr.ToInteger(&rv);
+  if (aMinCdmVersion != NO_CDM_VERSION &&
+      (NS_FAILED(rv) || version < 0 || aMinCdmVersion > version)) {
+    return MediaKeySystemStatus::Cdm_insufficient_version;
+  }
+
   return MediaKeySystemStatus::Available;
 }
 
 /* static */
 MediaKeySystemStatus
 MediaKeySystemAccess::GetKeySystemStatus(const nsAString& aKeySystem,
                                          int32_t aMinCdmVersion)
 {