Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(544)

Unified Diff: media/blink/webcontentdecryptionmoduleaccess_impl.cc

Issue 985113003: Block platform verification and file IO in the CDM adapter if the CDM configuration disallows them. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix DCHECK types. Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/blink/webcontentdecryptionmodule_impl.cc ('k') | media/blink/webencryptedmediaclient_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/webcontentdecryptionmoduleaccess_impl.cc
diff --git a/media/blink/webcontentdecryptionmoduleaccess_impl.cc b/media/blink/webcontentdecryptionmoduleaccess_impl.cc
index ab98b432058f8cff3981b761ef2072e61507df79..485a949b219ace3f30879b08ea3dc92edcf3bd1c 100644
--- a/media/blink/webcontentdecryptionmoduleaccess_impl.cc
+++ b/media/blink/webcontentdecryptionmoduleaccess_impl.cc
@@ -15,6 +15,8 @@ namespace media {
// The caller owns the created cdm (passed back using |result|).
static void CreateCdm(const base::WeakPtr<WebEncryptedMediaClientImpl>& client,
const blink::WebString& key_system,
+ bool allow_distinctive_identifier,
+ bool allow_persistent_state,
const blink::WebSecurityOrigin& security_origin,
blink::WebContentDecryptionModuleResult result) {
// If |client| is gone (due to the frame getting destroyed), it is
@@ -26,7 +28,8 @@ static void CreateCdm(const base::WeakPtr<WebEncryptedMediaClientImpl>& client,
return;
}
- client->CreateCdm(key_system, security_origin, result);
+ client->CreateCdm(key_system, allow_distinctive_identifier,
+ allow_persistent_state, security_origin, result);
}
WebContentDecryptionModuleAccessImpl*
@@ -60,13 +63,27 @@ WebContentDecryptionModuleAccessImpl::getConfiguration() {
void WebContentDecryptionModuleAccessImpl::createContentDecryptionModule(
blink::WebContentDecryptionModuleResult result) {
+ // Convert the accumulated configuration requirements to bools. Accumulated
+ // configurations never have optional requirements.
+ DCHECK(configuration_.distinctiveIdentifier !=
+ blink::WebMediaKeySystemConfiguration::Requirement::Optional);
+ DCHECK(configuration_.persistentState !=
+ blink::WebMediaKeySystemConfiguration::Requirement::Optional);
+ bool allow_distinctive_identifier =
+ (configuration_.distinctiveIdentifier ==
+ blink::WebMediaKeySystemConfiguration::Requirement::Required);
+ bool allow_persistent_state =
+ (configuration_.persistentState ==
+ blink::WebMediaKeySystemConfiguration::Requirement::Required);
+
// This method needs to run asynchronously, as it may need to load the CDM.
// As this object's lifetime is controlled by MediaKeySystemAccess on the
// blink side, copy all values needed by CreateCdm() in case the blink object
// gets garbage-collected.
base::MessageLoopProxy::current()->PostTask(
FROM_HERE,
- base::Bind(&CreateCdm, client_, key_system_, security_origin_, result));
+ base::Bind(&CreateCdm, client_, key_system_, allow_distinctive_identifier,
+ allow_persistent_state, security_origin_, result));
}
} // namespace media
« no previous file with comments | « media/blink/webcontentdecryptionmodule_impl.cc ('k') | media/blink/webencryptedmediaclient_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698