Bug 1306314 - Allow Widevine CDM process to contain multiple CDM instances and to have persistent storage. r=gerald draft
authorChris Pearce <cpearce@mozilla.com>
Mon, 14 Nov 2016 11:43:45 +1300
changeset 438368 ebca24d2eeb4acd5fb14e0063cf2065c419853b1
parent 438367 772d4bead18a9b88e7f9ee30b0f169a192322e24
child 438614 64252da423d8f4d267bb5dd7673a246664de54fa
child 438757 c2aa64328aa7518e3ebcd6ff0fe68c22e72946a8
push id35680
push usercpearce@mozilla.com
push dateMon, 14 Nov 2016 09:37:10 +0000
reviewersgerald
bugs1306314
milestone52.0a1
Bug 1306314 - Allow Widevine CDM process to contain multiple CDM instances and to have persistent storage. r=gerald This change ensures that we don't create a new random node Id for every MediaKeys object using Widevine - which has the effect of ensuring Widevine CDMs that are same origin get created in the same process, and that persistent storage can be used and retrieved. MozReview-Commit-ID: K55rkcu9jWo
dom/media/gmp/GMPServiceParent.cpp
--- a/dom/media/gmp/GMPServiceParent.cpp
+++ b/dom/media/gmp/GMPServiceParent.cpp
@@ -1383,25 +1383,22 @@ GeckoMediaPluginServiceParent::GetNodeId
   MOZ_ASSERT(NS_GetCurrentThread() == mGMPThread);
   LOGD(("%s::%s: (%s, %s), %s", __CLASS__, __FUNCTION__,
        NS_ConvertUTF16toUTF8(aOrigin).get(),
        NS_ConvertUTF16toUTF8(aTopLevelOrigin).get(),
        (aInPrivateBrowsing ? "PrivateBrowsing" : "NonPrivateBrowsing")));
 
   nsresult rv;
 
-  if (aGMPName.EqualsLiteral("gmp-widevinecdm") ||
-      aOrigin.EqualsLiteral("null") ||
+  if (aOrigin.EqualsLiteral("null") ||
       aOrigin.IsEmpty() ||
       aTopLevelOrigin.EqualsLiteral("null") ||
       aTopLevelOrigin.IsEmpty()) {
-    // This is for the Google Widevine CDM, which doesn't have persistent
-    // storage and which can't handle being used by more than one origin at
-    // once in the same plugin instance, or at least one of the
-    // (origin, topLevelOrigin) is null or empty; probably a local file.
+    // (origin, topLevelOrigin) is null or empty; this is for an anonymous
+    // origin, probably a local file, for which we don't provide persistent storage.
     // Generate a random node id, and don't store it so that the GMP's storage
     // is temporary and the process for this GMP is not shared with GMP
     // instances that have the same nodeId.
     nsAutoCString salt;
     rv = GenerateRandomPathName(salt, NodeIdSaltLength);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }