mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 19:35:51 +00:00
Bug 1245789 - Ensure Widevine's nodeId are always unique and not permitted persistent storage. r=gerald
This ensures that we don't try to use one GMP instance to service multiple same-origin MediaKeys' CDM access, as the Widevine CDM's Chromium interface is synchronous, so it doesn't handle running multiple decoders well. Multiple same-origin GMPs can't safely use the same storage concurrently, but thankfully Widevine doesn't require persistent storage, so we can just disallow that entirely and avoid the problem. MozReview-Commit-ID: 78I4IIGgHRA
This commit is contained in:
parent
cb3b390405
commit
da09cd13c1
@ -1253,13 +1253,18 @@ GeckoMediaPluginServiceParent::GetNodeId(const nsAString& aOrigin,
|
||||
|
||||
nsresult rv;
|
||||
|
||||
if (aOrigin.EqualsLiteral("null") ||
|
||||
if (aGMPName.EqualsLiteral("gmp-widevinecdm") ||
|
||||
aOrigin.EqualsLiteral("null") ||
|
||||
aOrigin.IsEmpty() ||
|
||||
aTopLevelOrigin.EqualsLiteral("null") ||
|
||||
aTopLevelOrigin.IsEmpty()) {
|
||||
// At least one of the (origin, topLevelOrigin) is null or empty;
|
||||
// probably a local file. Generate a random node id, and don't store
|
||||
// it so that the GMP's storage is temporary and not shared.
|
||||
// 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.
|
||||
// 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))) {
|
||||
|
Loading…
Reference in New Issue
Block a user