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

--HG--
extra : rebase_source : 9bd789d05d1f5ed0a00eeb9870668e6335e899e6
This commit is contained in:
Chris Pearce 2016-11-14 11:43:45 +13:00
parent 14a0cc34ed
commit 21137c728b

View File

@ -1388,15 +1388,12 @@ GeckoMediaPluginServiceParent::GetNodeId(const nsAString& aOrigin,
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.