Index: media/blink/webencryptedmediaclient_impl.cc |
diff --git a/media/blink/webencryptedmediaclient_impl.cc b/media/blink/webencryptedmediaclient_impl.cc |
index dd7a2dc65f70991a5646665659bb7ce113c37ecd..ea2be5d8e4beef3ec1a0f64ab7d706ec34b8d8d0 100644 |
--- a/media/blink/webencryptedmediaclient_impl.cc |
+++ b/media/blink/webencryptedmediaclient_impl.cc |
@@ -78,12 +78,18 @@ class WebEncryptedMediaClientImpl::Reporter { |
}; |
WebEncryptedMediaClientImpl::WebEncryptedMediaClientImpl( |
+#if defined(OS_ANDROID) |
+ base::Callback<bool(void)> allow_secure_surfaces_cb, |
+#endif // defined(OS_ANDROID) |
CdmFactory* cdm_factory, |
MediaPermission* media_permission) |
: cdm_factory_(cdm_factory), |
key_system_config_selector_(KeySystems::GetInstance(), media_permission), |
weak_factory_(this) { |
DCHECK(cdm_factory_); |
+#if defined(OS_ANDROID) |
+ allow_secure_surfaces_cb_ = allow_secure_surfaces_cb; |
+#endif // defined(OS_ANDROID) |
} |
WebEncryptedMediaClientImpl::~WebEncryptedMediaClientImpl() { |
@@ -93,8 +99,11 @@ void WebEncryptedMediaClientImpl::requestMediaKeySystemAccess( |
blink::WebEncryptedMediaRequest request) { |
GetReporter(request.keySystem())->ReportRequested(); |
key_system_config_selector_.SelectConfig( |
- request.keySystem(), request.supportedConfigurations(), |
- request.securityOrigin(), |
+ request.keySystem(), |
+#if defined(OS_ANDROID) |
+ allow_secure_surfaces_cb_.Run(), |
+#endif // defined(OS_ANDROID) |
+ request.supportedConfigurations(), request.securityOrigin(), |
base::Bind(&WebEncryptedMediaClientImpl::OnRequestSucceeded, |
weak_factory_.GetWeakPtr(), request), |
base::Bind(&WebEncryptedMediaClientImpl::OnRequestNotSupported, |
@@ -114,8 +123,16 @@ void WebEncryptedMediaClientImpl::CreateCdm( |
void WebEncryptedMediaClientImpl::OnRequestSucceeded( |
blink::WebEncryptedMediaRequest request, |
- const blink::WebMediaKeySystemConfiguration& accumulated_configuration) { |
+ const blink::WebMediaKeySystemConfiguration& accumulated_configuration, |
+#if defined(OS_ANDROID) |
+ const bool require_secure_surfaces, |
ddorwin
2015/05/06 02:17:12
no const
sandersd (OOO until July 31)
2015/05/08 00:37:42
Done.
|
+#endif // defined(OS_ANDROID) |
+ ) { |
+ if (!request.allow_seure_surfaces) |
+ DCHECK(!require_secure_surfaces); |
GetReporter(request.keySystem())->ReportSupported(); |
+ // TODO(sandersd): Pass |require_secure_surfaces| along and use it to |
ddorwin
2015/05/06 02:17:12
Ideally, we would pass along something generic, su
sandersd (OOO until July 31)
2015/05/08 00:37:42
This is in the same category as |allow_persistent_
ddorwin
2015/05/08 03:18:31
We can infer those from the accumulated_configurat
sandersd (OOO until July 31)
2015/05/08 18:04:45
Yes, I am considering passing all three of those b
|
+ // configure the CDM security level on Android. |
request.requestSucceeded(WebContentDecryptionModuleAccessImpl::Create( |
request.keySystem(), accumulated_configuration, request.securityOrigin(), |
weak_factory_.GetWeakPtr())); |