Chromium Code Reviews| Index: media/blink/webencryptedmediaclient_impl.cc |
| diff --git a/media/blink/webencryptedmediaclient_impl.cc b/media/blink/webencryptedmediaclient_impl.cc |
| index af7b7f487a99cc44cf5254257835e1d4c8fbdfe9..755bbe29ee11620a33670cfbb3fd88ababde7de9 100644 |
| --- a/media/blink/webencryptedmediaclient_impl.cc |
| +++ b/media/blink/webencryptedmediaclient_impl.cc |
| @@ -4,10 +4,12 @@ |
| #include "webencryptedmediaclient_impl.h" |
| +#include "base/bind.h" |
| #include "base/logging.h" |
| #include "base/strings/string_util.h" |
| #include "base/strings/utf_string_conversions.h" |
| #include "media/base/key_systems.h" |
| +#include "media/base/media_permission.h" |
| #include "net/base/mime_util.h" |
| #include "third_party/WebKit/public/platform/WebEncryptedMediaRequest.h" |
| #include "third_party/WebKit/public/platform/WebMediaKeySystemConfiguration.h" |
| @@ -131,17 +133,27 @@ static bool GetSupportedConfiguration( |
| } |
| WebEncryptedMediaClientImpl::WebEncryptedMediaClientImpl( |
| - scoped_ptr<CdmFactory> cdm_factory) |
| - : cdm_factory_(cdm_factory.Pass()) { |
| + scoped_ptr<CdmFactory> cdm_factory, |
| + MediaPermission* media_permission) |
| + : cdm_factory_(cdm_factory.Pass()), media_permission_(media_permission) { |
| } |
| WebEncryptedMediaClientImpl::~WebEncryptedMediaClientImpl() { |
| } |
| +static void OnPermissionStatus(bool granted) { |
| + DVLOG(2) << __FUNCTION__ << ": " << granted; |
| +} |
| + |
| void WebEncryptedMediaClientImpl::requestMediaKeySystemAccess( |
| blink::WebEncryptedMediaRequest request) { |
| // TODO(jrummell): This should be asynchronous. |
| + GURL security_origin_as_gurl(request.securityOrigin().toString()); |
| + media_permission_->HasPermission(MediaPermission::PROTECTED_MEDIA_IDENTIFIER, |
| + security_origin_as_gurl, |
| + base::Bind(&OnPermissionStatus)); |
|
xhwang
2015/01/22 23:40:54
FYI: This is how I test this CL with LayoutTests/m
|
| + |
| // Continued from requestMediaKeySystemAccess(), step 7, from |
| // https://w3c.github.io/encrypted-media/#requestmediakeysystemaccess |
| // |