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

Unified Diff: media/blink/webencryptedmediaclient_impl.cc

Issue 1124863005: Restrict use of hardware-secure codecs based on the RendererPreference. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@setsecurity
Patch Set: Correct unittests. Created 5 years, 7 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/webencryptedmediaclient_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/webencryptedmediaclient_impl.cc
diff --git a/media/blink/webencryptedmediaclient_impl.cc b/media/blink/webencryptedmediaclient_impl.cc
index dd7a2dc65f70991a5646665659bb7ce113c37ecd..3ce96ed8a2412559afcbf86e1833c6c78134b660 100644
--- a/media/blink/webencryptedmediaclient_impl.cc
+++ b/media/blink/webencryptedmediaclient_impl.cc
@@ -78,9 +78,11 @@ class WebEncryptedMediaClientImpl::Reporter {
};
WebEncryptedMediaClientImpl::WebEncryptedMediaClientImpl(
+ base::Callback<bool(void)> are_secure_codecs_supported_cb,
CdmFactory* cdm_factory,
MediaPermission* media_permission)
- : cdm_factory_(cdm_factory),
+ : are_secure_codecs_supported_cb_(are_secure_codecs_supported_cb),
+ cdm_factory_(cdm_factory),
key_system_config_selector_(KeySystems::GetInstance(), media_permission),
weak_factory_(this) {
DCHECK(cdm_factory_);
@@ -94,7 +96,7 @@ void WebEncryptedMediaClientImpl::requestMediaKeySystemAccess(
GetReporter(request.keySystem())->ReportRequested();
key_system_config_selector_.SelectConfig(
request.keySystem(), request.supportedConfigurations(),
- request.securityOrigin(),
+ request.securityOrigin(), are_secure_codecs_supported_cb_.Run(),
base::Bind(&WebEncryptedMediaClientImpl::OnRequestSucceeded,
weak_factory_.GetWeakPtr(), request),
base::Bind(&WebEncryptedMediaClientImpl::OnRequestNotSupported,
@@ -114,8 +116,11 @@ void WebEncryptedMediaClientImpl::CreateCdm(
void WebEncryptedMediaClientImpl::OnRequestSucceeded(
blink::WebEncryptedMediaRequest request,
- const blink::WebMediaKeySystemConfiguration& accumulated_configuration) {
+ const blink::WebMediaKeySystemConfiguration& accumulated_configuration,
+ bool are_secure_codecs_required) {
GetReporter(request.keySystem())->ReportSupported();
+ // TODO(sandersd): Pass |are_secure_codecs_required| along and use it to
+ // configure the CDM security level and use of secure surfaces on Android.
request.requestSucceeded(WebContentDecryptionModuleAccessImpl::Create(
request.keySystem(), accumulated_configuration, request.securityOrigin(),
weak_factory_.GetWeakPtr()));
« no previous file with comments | « media/blink/webencryptedmediaclient_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698