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

Unified Diff: media/blink/webencryptedmediaclient_impl.cc

Issue 871663003: media: Add MediaPermission interface and MediaPermissionDispatcher. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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') | media/media.gyp » ('j') | 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 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
//
« no previous file with comments | « media/blink/webencryptedmediaclient_impl.h ('k') | media/media.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698