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

Side by Side Diff: third_party/WebKit/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp

Issue 2834463002: Move CreateDOMException out of V8ThrowException (Closed)
Patch Set: Add comments Created 3 years, 8 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
« no previous file with comments | « third_party/WebKit/Source/modules/encryptedmedia/ContentDecryptionModuleResultPromise.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/encryptedmedia/ContentDecryptionModuleResultPromise.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698