| 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/SimpleContentDecryptionModuleResult.h" | 6 #include "modules/encryptedmedia/SimpleContentDecryptionModuleResult.h" |
| 7 | 7 |
| 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/V8Binding.h" | 11 #include "bindings/core/v8/V8Binding.h" |
| 12 #include "core/dom/DOMException.h" | 12 #include "core/dom/DOMException.h" |
| 13 #include "platform/Logging.h" | 13 #include "platform/Logging.h" |
| 14 #include "public/platform/WebString.h" | 14 #include "public/platform/WebString.h" |
| 15 #include "wtf/Assertions.h" | 15 #include "wtf/Assertions.h" |
| 16 | 16 |
| 17 namespace WebCore { | 17 namespace blink { |
| 18 | 18 |
| 19 ExceptionCode WebCdmExceptionToExceptionCode(blink::WebContentDecryptionModuleEx
ception cdmException) | 19 ExceptionCode WebCdmExceptionToExceptionCode(blink::WebContentDecryptionModuleEx
ception cdmException) |
| 20 { | 20 { |
| 21 switch (cdmException) { | 21 switch (cdmException) { |
| 22 case blink::WebContentDecryptionModuleExceptionNotSupportedError: | 22 case blink::WebContentDecryptionModuleExceptionNotSupportedError: |
| 23 return NotSupportedError; | 23 return NotSupportedError; |
| 24 case blink::WebContentDecryptionModuleExceptionInvalidStateError: | 24 case blink::WebContentDecryptionModuleExceptionInvalidStateError: |
| 25 return InvalidStateError; | 25 return InvalidStateError; |
| 26 case blink::WebContentDecryptionModuleExceptionInvalidAccessError: | 26 case blink::WebContentDecryptionModuleExceptionInvalidAccessError: |
| 27 return InvalidAccessError; | 27 return InvalidAccessError; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 { | 71 { |
| 72 return m_resolver->promise(); | 72 return m_resolver->promise(); |
| 73 } | 73 } |
| 74 | 74 |
| 75 void SimpleContentDecryptionModuleResult::completeWithDOMException(ExceptionCode
code, const String& errorMessage) | 75 void SimpleContentDecryptionModuleResult::completeWithDOMException(ExceptionCode
code, const String& errorMessage) |
| 76 { | 76 { |
| 77 m_resolver->reject(DOMException::create(code, errorMessage)); | 77 m_resolver->reject(DOMException::create(code, errorMessage)); |
| 78 m_resolver.clear(); | 78 m_resolver.clear(); |
| 79 } | 79 } |
| 80 | 80 |
| 81 } // namespace WebCore | 81 } // namespace blink |
| OLD | NEW |