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

Side by Side 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: Remove test code. 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "webencryptedmediaclient_impl.h" 5 #include "webencryptedmediaclient_impl.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "media/base/key_systems.h" 10 #include "media/base/key_systems.h"
11 #include "media/base/media_permission.h"
11 #include "net/base/mime_util.h" 12 #include "net/base/mime_util.h"
12 #include "third_party/WebKit/public/platform/WebEncryptedMediaRequest.h" 13 #include "third_party/WebKit/public/platform/WebEncryptedMediaRequest.h"
13 #include "third_party/WebKit/public/platform/WebMediaKeySystemConfiguration.h" 14 #include "third_party/WebKit/public/platform/WebMediaKeySystemConfiguration.h"
14 #include "third_party/WebKit/public/platform/WebString.h" 15 #include "third_party/WebKit/public/platform/WebString.h"
15 #include "third_party/WebKit/public/platform/WebVector.h" 16 #include "third_party/WebKit/public/platform/WebVector.h"
16 #include "webcontentdecryptionmoduleaccess_impl.h" 17 #include "webcontentdecryptionmoduleaccess_impl.h"
17 18
18 namespace media { 19 namespace media {
19 20
20 static bool IsSupportedContentType( 21 static bool IsSupportedContentType(
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 } 125 }
125 126
126 // TODO(sandersd): Prompt for distinctive identifiers and/or persistent state 127 // TODO(sandersd): Prompt for distinctive identifiers and/or persistent state
127 // if required. Make sure that future checks are silent. 128 // if required. Make sure that future checks are silent.
128 // http://crbug.com/446263. 129 // http://crbug.com/446263.
129 130
130 return true; 131 return true;
131 } 132 }
132 133
133 WebEncryptedMediaClientImpl::WebEncryptedMediaClientImpl( 134 WebEncryptedMediaClientImpl::WebEncryptedMediaClientImpl(
134 scoped_ptr<CdmFactory> cdm_factory) 135 scoped_ptr<CdmFactory> cdm_factory,
135 : cdm_factory_(cdm_factory.Pass()) { 136 MediaPermission* media_permission)
137 : cdm_factory_(cdm_factory.Pass()), media_permission_(media_permission) {
136 } 138 }
137 139
138 WebEncryptedMediaClientImpl::~WebEncryptedMediaClientImpl() { 140 WebEncryptedMediaClientImpl::~WebEncryptedMediaClientImpl() {
139 } 141 }
140 142
141 void WebEncryptedMediaClientImpl::requestMediaKeySystemAccess( 143 void WebEncryptedMediaClientImpl::requestMediaKeySystemAccess(
142 blink::WebEncryptedMediaRequest request) { 144 blink::WebEncryptedMediaRequest request) {
143 // TODO(jrummell): This should be asynchronous. 145 // TODO(jrummell): This should be asynchronous.
144 146
145 // Continued from requestMediaKeySystemAccess(), step 7, from 147 // Continued from requestMediaKeySystemAccess(), step 7, from
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 return; 193 return;
192 } 194 }
193 } 195 }
194 196
195 // 7.4 Reject promise with a new DOMException whose name is NotSupportedError. 197 // 7.4 Reject promise with a new DOMException whose name is NotSupportedError.
196 request.requestNotSupported( 198 request.requestNotSupported(
197 "None of the requested configurations were supported."); 199 "None of the requested configurations were supported.");
198 } 200 }
199 201
200 } // namespace media 202 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698