Chromium Code Reviews| 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 <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "bindings/core/v8/ScriptPromise.h" | 9 #include "bindings/core/v8/ScriptPromise.h" |
| 10 #include "bindings/core/v8/ScriptPromiseResolver.h" | 10 #include "bindings/core/v8/ScriptPromiseResolver.h" |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 320 // 3. Let document be the calling context's Document. | 320 // 3. Let document be the calling context's Document. |
| 321 // (Done at the begining of this function.) | 321 // (Done at the begining of this function.) |
| 322 if (!document->GetPage()) { | 322 if (!document->GetPage()) { |
| 323 return ScriptPromise::RejectWithDOMException( | 323 return ScriptPromise::RejectWithDOMException( |
| 324 script_state, | 324 script_state, |
| 325 DOMException::Create( | 325 DOMException::Create( |
| 326 kInvalidStateError, | 326 kInvalidStateError, |
| 327 "The context provided is not associated with a page.")); | 327 "The context provided is not associated with a page.")); |
| 328 } | 328 } |
| 329 | 329 |
| 330 Deprecation::CountDeprecationCrossOriginIframe( | |
|
iclelland
2017/06/22 15:12:48
This appears to print a deprecation message (and c
raymes
2017/07/05 01:04:25
Updated to only count if:
-Disabled by FP, and
-In
| |
| 331 *document, WebFeature::kEncryptedMediaDisabledIframe); | |
| 332 | |
| 330 // 4. Let origin be the origin of document. | 333 // 4. Let origin be the origin of document. |
| 331 // (Passed with the execution context.) | 334 // (Passed with the execution context.) |
| 332 | 335 |
| 333 // 5. Let promise be a new promise. | 336 // 5. Let promise be a new promise. |
| 334 MediaKeySystemAccessInitializer* initializer = | 337 MediaKeySystemAccessInitializer* initializer = |
| 335 new MediaKeySystemAccessInitializer(script_state, key_system, | 338 new MediaKeySystemAccessInitializer(script_state, key_system, |
| 336 supported_configurations); | 339 supported_configurations); |
| 337 ScriptPromise promise = initializer->Promise(); | 340 ScriptPromise promise = initializer->Promise(); |
| 338 | 341 |
| 339 // 6. Asynchronously determine support, and if allowed, create and | 342 // 6. Asynchronously determine support, and if allowed, create and |
| 340 // initialize the MediaKeySystemAccess object. | 343 // initialize the MediaKeySystemAccess object. |
| 341 MediaKeysController* controller = | 344 MediaKeysController* controller = |
| 342 MediaKeysController::From(document->GetPage()); | 345 MediaKeysController::From(document->GetPage()); |
| 343 WebEncryptedMediaClient* media_client = | 346 WebEncryptedMediaClient* media_client = |
| 344 controller->EncryptedMediaClient(execution_context); | 347 controller->EncryptedMediaClient(execution_context); |
| 345 media_client->RequestMediaKeySystemAccess( | 348 media_client->RequestMediaKeySystemAccess( |
| 346 WebEncryptedMediaRequest(initializer)); | 349 WebEncryptedMediaRequest(initializer)); |
| 347 | 350 |
| 348 // 7. Return promise. | 351 // 7. Return promise. |
| 349 return promise; | 352 return promise; |
| 350 } | 353 } |
| 351 | 354 |
| 352 } // namespace blink | 355 } // namespace blink |
| OLD | NEW |