Bug 1306314 - Allow Widevine CDM process to contain multiple CDM instances and to have persistent storage. r=gerald, a=gchang
authorChris Pearce <cpearce@mozilla.com>
Mon, 14 Nov 2016 11:43:45 +1300
changeset 352467 95365d11eb8141dfe64bb76a87e2256f94452b60
parent 352466 9c65ea0f38af6415305003fb8d4d4405add94c6e
child 352468 e0666d53b25a9cea2b0669db8ae60b83f26958f8
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald, gchang
bugs1306314
milestone52.0a2
Bug 1306314 - Allow Widevine CDM process to contain multiple CDM instances and to have persistent storage. r=gerald, a=gchang 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;
     }