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/HTMLMediaElementEncryptedMedia.h" | 5 #include "modules/encryptedmedia/HTMLMediaElementEncryptedMedia.h" |
6 | 6 |
7 #include "bindings/core/v8/ExceptionState.h" | 7 #include "bindings/core/v8/ExceptionState.h" |
8 #include "bindings/core/v8/ScriptPromise.h" | 8 #include "bindings/core/v8/ScriptPromise.h" |
9 #include "bindings/core/v8/ScriptPromiseResolver.h" | 9 #include "bindings/core/v8/ScriptPromiseResolver.h" |
10 #include "bindings/core/v8/ScriptState.h" | 10 #include "bindings/core/v8/ScriptState.h" |
11 #include "bindings/core/v8/V8ThrowException.h" | 11 #include "bindings/core/v8/V8ThrowDOMException.h" |
12 #include "core/dom/DOMException.h" | 12 #include "core/dom/DOMException.h" |
13 #include "core/dom/DOMTypedArray.h" | 13 #include "core/dom/DOMTypedArray.h" |
14 #include "core/dom/ExceptionCode.h" | 14 #include "core/dom/ExceptionCode.h" |
15 #include "core/dom/TaskRunnerHelper.h" | 15 #include "core/dom/TaskRunnerHelper.h" |
16 #include "core/html/HTMLMediaElement.h" | 16 #include "core/html/HTMLMediaElement.h" |
17 #include "modules/encryptedmedia/ContentDecryptionModuleResultPromise.h" | 17 #include "modules/encryptedmedia/ContentDecryptionModuleResultPromise.h" |
18 #include "modules/encryptedmedia/EncryptedMediaUtils.h" | 18 #include "modules/encryptedmedia/EncryptedMediaUtils.h" |
19 #include "modules/encryptedmedia/MediaEncryptedEvent.h" | 19 #include "modules/encryptedmedia/MediaEncryptedEvent.h" |
20 #include "modules/encryptedmedia/MediaKeys.h" | 20 #include "modules/encryptedmedia/MediaKeys.h" |
21 #include "platform/ContentDecryptionModuleResult.h" | 21 #include "platform/ContentDecryptionModuleResult.h" |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 if (made_reservation_) | 256 if (made_reservation_) |
257 new_media_keys_->CancelReservation(); | 257 new_media_keys_->CancelReservation(); |
258 | 258 |
259 // Make sure attaching media keys value is false. | 259 // Make sure attaching media keys value is false. |
260 DCHECK(!HTMLMediaElementEncryptedMedia::From(*element_) | 260 DCHECK(!HTMLMediaElementEncryptedMedia::From(*element_) |
261 .is_attaching_media_keys_); | 261 .is_attaching_media_keys_); |
262 | 262 |
263 // Reject promise with an appropriate error. | 263 // Reject promise with an appropriate error. |
264 ScriptState::Scope scope(GetScriptState()); | 264 ScriptState::Scope scope(GetScriptState()); |
265 v8::Isolate* isolate = GetScriptState()->GetIsolate(); | 265 v8::Isolate* isolate = GetScriptState()->GetIsolate(); |
266 Reject(V8ThrowException::CreateDOMException(isolate, code, error_message)); | 266 Reject(V8ThrowDOMException::CreateDOMException(isolate, code, error_message)); |
267 } | 267 } |
268 | 268 |
269 void SetMediaKeysHandler::ClearFailed(ExceptionCode code, | 269 void SetMediaKeysHandler::ClearFailed(ExceptionCode code, |
270 const String& error_message) { | 270 const String& error_message) { |
271 DVLOG(EME_LOG_LEVEL) << __func__ << "(" << code << ", " << error_message | 271 DVLOG(EME_LOG_LEVEL) << __func__ << "(" << code << ", " << error_message |
272 << ")"; | 272 << ")"; |
273 HTMLMediaElementEncryptedMedia& this_element = | 273 HTMLMediaElementEncryptedMedia& this_element = |
274 HTMLMediaElementEncryptedMedia::From(*element_); | 274 HTMLMediaElementEncryptedMedia::From(*element_); |
275 | 275 |
276 // 5.2.4 If the preceding step failed, let this object's attaching media | 276 // 5.2.4 If the preceding step failed, let this object's attaching media |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 return media_keys_ ? media_keys_->ContentDecryptionModule() : 0; | 444 return media_keys_ ? media_keys_->ContentDecryptionModule() : 0; |
445 } | 445 } |
446 | 446 |
447 DEFINE_TRACE(HTMLMediaElementEncryptedMedia) { | 447 DEFINE_TRACE(HTMLMediaElementEncryptedMedia) { |
448 visitor->Trace(media_element_); | 448 visitor->Trace(media_element_); |
449 visitor->Trace(media_keys_); | 449 visitor->Trace(media_keys_); |
450 Supplement<HTMLMediaElement>::Trace(visitor); | 450 Supplement<HTMLMediaElement>::Trace(visitor); |
451 } | 451 } |
452 | 452 |
453 } // namespace blink | 453 } // namespace blink |
OLD | NEW |