Bug 1180610 - Handle EME plugin voucher disappearing after installation before restart. r=jw_wang, a=lmandel
☠☠ backed out by 1cf45ce3ff0e ☠ ☠
authorChris Pearce <cpearce@mozilla.com>
Mon, 06 Jul 2015 21:59:07 +1200
changeset 275248 a788bdae916d6fe385245d33ecae2e429c7c6ca2
parent 275247 0cdd7df90394e539c54f388c29a2032e4120c105
child 275249 2302c8976f6aa50264f980da050d5a401d72679d
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,24 @@ 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)) {
+    aOutMessage = NS_LITERAL_CSTRING("Installed CDM version insufficient");
+    return MediaKeySystemStatus::Cdm_insufficient_version;
+  }
+
   return MediaKeySystemStatus::Available;
 }
 
 /* static */
 MediaKeySystemStatus
 MediaKeySystemAccess::GetKeySystemStatus(const nsAString& aKeySystem,
                                          int32_t aMinCdmVersion)
 {