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 "config.h" | 5 #include "config.h" |
6 #include "modules/encryptedmedia/HTMLMediaElementEncryptedMedia.h" | 6 #include "modules/encryptedmedia/HTMLMediaElementEncryptedMedia.h" |
7 | 7 |
8 #include "bindings/core/v8/ExceptionState.h" | 8 #include "bindings/core/v8/ExceptionState.h" |
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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 { | 92 { |
93 (*m_successCallback)(); | 93 (*m_successCallback)(); |
94 } | 94 } |
95 | 95 |
96 virtual void completeWithContentDecryptionModule(WebContentDecryptionModule*
) override | 96 virtual void completeWithContentDecryptionModule(WebContentDecryptionModule*
) override |
97 { | 97 { |
98 ASSERT_NOT_REACHED(); | 98 ASSERT_NOT_REACHED(); |
99 (*m_failureCallback)(InvalidStateError, "Unexpected completion."); | 99 (*m_failureCallback)(InvalidStateError, "Unexpected completion."); |
100 } | 100 } |
101 | 101 |
102 virtual void completeWithSession(blink::WebContentDecryptionModuleResult::Se
ssionStatus status) override | 102 virtual void completeWithSession(WebContentDecryptionModuleResult::SessionSt
atus status) override |
103 { | 103 { |
104 ASSERT_NOT_REACHED(); | 104 ASSERT_NOT_REACHED(); |
105 (*m_failureCallback)(InvalidStateError, "Unexpected completion."); | 105 (*m_failureCallback)(InvalidStateError, "Unexpected completion."); |
106 } | 106 } |
107 | 107 |
108 virtual void completeWithError(blink::WebContentDecryptionModuleException co
de, unsigned long systemCode, const blink::WebString& message) override | 108 virtual void completeWithError(WebContentDecryptionModuleException code, uns
igned long systemCode, const WebString& message) override |
109 { | 109 { |
110 // Non-zero |systemCode| is appended to the |message|. If the |message| | 110 // Non-zero |systemCode| is appended to the |message|. If the |message| |
111 // is empty, we'll report "Rejected with system code (systemCode)". | 111 // is empty, we'll report "Rejected with system code (systemCode)". |
112 String errorString = message; | 112 String errorString = message; |
113 if (systemCode != 0) { | 113 if (systemCode != 0) { |
114 if (errorString.isEmpty()) | 114 if (errorString.isEmpty()) |
115 errorString.append("Rejected with system code"); | 115 errorString.append("Rejected with system code"); |
116 errorString.append(" (" + String::number(systemCode) + ")"); | 116 errorString.append(" (" + String::number(systemCode) + ")"); |
117 } | 117 } |
118 (*m_failureCallback)(WebCdmExceptionToExceptionCode(code), errorString); | 118 (*m_failureCallback)(WebCdmExceptionToExceptionCode(code), errorString); |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
606 return thisElement.contentDecryptionModule(); | 606 return thisElement.contentDecryptionModule(); |
607 } | 607 } |
608 | 608 |
609 DEFINE_TRACE(HTMLMediaElementEncryptedMedia) | 609 DEFINE_TRACE(HTMLMediaElementEncryptedMedia) |
610 { | 610 { |
611 visitor->trace(m_mediaKeys); | 611 visitor->trace(m_mediaKeys); |
612 WillBeHeapSupplement<HTMLMediaElement>::trace(visitor); | 612 WillBeHeapSupplement<HTMLMediaElement>::trace(visitor); |
613 } | 613 } |
614 | 614 |
615 } // namespace blink | 615 } // namespace blink |
OLD | NEW |