OLD | NEW |
---|---|
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 "modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.h" | 5 #include "modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.h" |
6 | 6 |
7 #include "bindings/core/v8/ScriptPromiseResolver.h" | 7 #include "bindings/core/v8/ScriptPromiseResolver.h" |
8 #include "bindings/core/v8/ScriptState.h" | 8 #include "bindings/core/v8/ScriptState.h" |
9 #include "core/dom/DOMException.h" | 9 #include "core/dom/DOMException.h" |
10 #include "core/dom/Document.h" | 10 #include "core/dom/Document.h" |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
244 } | 244 } |
245 | 245 |
246 } // namespace | 246 } // namespace |
247 | 247 |
248 ScriptPromise NavigatorRequestMediaKeySystemAccess::requestMediaKeySystemAccess( | 248 ScriptPromise NavigatorRequestMediaKeySystemAccess::requestMediaKeySystemAccess( |
249 ScriptState* scriptState, | 249 ScriptState* scriptState, |
250 Navigator& navigator, | 250 Navigator& navigator, |
251 const String& keySystem, | 251 const String& keySystem, |
252 const HeapVector<MediaKeySystemConfiguration>& supportedConfigurations) | 252 const HeapVector<MediaKeySystemConfiguration>& supportedConfigurations) |
253 { | 253 { |
254 DVLOG(3) << __FUNCTION__; | 254 DVLOG(3) << __func__; |
esprehn
2016/07/20 06:12:02
Should this be pretty function? I guess DVLog has
Peter Kasting
2016/07/20 06:16:39
Yes, DVLOG will already print the file name and li
| |
255 | 255 |
256 // From https://w3c.github.io/encrypted-media/#requestMediaKeySystemAccess | 256 // From https://w3c.github.io/encrypted-media/#requestMediaKeySystemAccess |
257 // When this method is invoked, the user agent must run the following steps: | 257 // When this method is invoked, the user agent must run the following steps: |
258 // 1. If keySystem is an empty string, return a promise rejected with a | 258 // 1. If keySystem is an empty string, return a promise rejected with a |
259 // new DOMException whose name is InvalidAccessError. | 259 // new DOMException whose name is InvalidAccessError. |
260 if (keySystem.isEmpty()) { | 260 if (keySystem.isEmpty()) { |
261 return ScriptPromise::rejectWithDOMException( | 261 return ScriptPromise::rejectWithDOMException( |
262 scriptState, DOMException::create(InvalidAccessError, "The keySystem parameter is empty.")); | 262 scriptState, DOMException::create(InvalidAccessError, "The keySystem parameter is empty.")); |
263 } | 263 } |
264 | 264 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
298 // initialize the MediaKeySystemAccess object. | 298 // initialize the MediaKeySystemAccess object. |
299 MediaKeysController* controller = MediaKeysController::from(document->page() ); | 299 MediaKeysController* controller = MediaKeysController::from(document->page() ); |
300 WebEncryptedMediaClient* mediaClient = controller->encryptedMediaClient(exec utionContext); | 300 WebEncryptedMediaClient* mediaClient = controller->encryptedMediaClient(exec utionContext); |
301 mediaClient->requestMediaKeySystemAccess(WebEncryptedMediaRequest(initialize r)); | 301 mediaClient->requestMediaKeySystemAccess(WebEncryptedMediaRequest(initialize r)); |
302 | 302 |
303 // 8. Return promise. | 303 // 8. Return promise. |
304 return promise; | 304 return promise; |
305 } | 305 } |
306 | 306 |
307 } // namespace blink | 307 } // namespace blink |
OLD | NEW |