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
--- 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;
}