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 #ifndef SimpleContentDecryptionModuleResult_h | 5 #ifndef SimpleContentDecryptionModuleResult_h |
6 #define SimpleContentDecryptionModuleResult_h | 6 #define SimpleContentDecryptionModuleResult_h |
7 | 7 |
8 #include "core/dom/ExceptionCode.h" | 8 #include "core/dom/ExceptionCode.h" |
9 #include "platform/ContentDecryptionModuleResult.h" | 9 #include "platform/ContentDecryptionModuleResult.h" |
10 #include "wtf/Forward.h" | 10 #include "wtf/Forward.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 // to fullfill the promise. This implementation of complete() will resolve the | 22 // to fullfill the promise. This implementation of complete() will resolve the |
23 // promise with undefined, while completeWithError() reject the promise with an | 23 // promise with undefined, while completeWithError() reject the promise with an |
24 // exception. completeWithSession() is not expected to be called, and will | 24 // exception. completeWithSession() is not expected to be called, and will |
25 // reject the promise. | 25 // reject the promise. |
26 class SimpleContentDecryptionModuleResult : public ContentDecryptionModuleResult
{ | 26 class SimpleContentDecryptionModuleResult : public ContentDecryptionModuleResult
{ |
27 public: | 27 public: |
28 explicit SimpleContentDecryptionModuleResult(ScriptState*); | 28 explicit SimpleContentDecryptionModuleResult(ScriptState*); |
29 virtual ~SimpleContentDecryptionModuleResult(); | 29 virtual ~SimpleContentDecryptionModuleResult(); |
30 | 30 |
31 // ContentDecryptionModuleResult implementation. | 31 // ContentDecryptionModuleResult implementation. |
32 virtual void complete() OVERRIDE; | 32 virtual void complete() override; |
33 virtual void completeWithSession(WebContentDecryptionModuleResult::SessionSt
atus) OVERRIDE; | 33 virtual void completeWithSession(WebContentDecryptionModuleResult::SessionSt
atus) override; |
34 virtual void completeWithError(WebContentDecryptionModuleException, unsigned
long systemCode, const WebString&) OVERRIDE; | 34 virtual void completeWithError(WebContentDecryptionModuleException, unsigned
long systemCode, const WebString&) override; |
35 | 35 |
36 // It is only valid to call this before completion. | 36 // It is only valid to call this before completion. |
37 ScriptPromise promise(); | 37 ScriptPromise promise(); |
38 | 38 |
39 private: | 39 private: |
40 // Reject the promise with a DOMException. | 40 // Reject the promise with a DOMException. |
41 void completeWithDOMException(ExceptionCode, const String& errorMessage); | 41 void completeWithDOMException(ExceptionCode, const String& errorMessage); |
42 | 42 |
43 RefPtr<ScriptPromiseResolver> m_resolver; | 43 RefPtr<ScriptPromiseResolver> m_resolver; |
44 }; | 44 }; |
45 | 45 |
46 } // namespace blink | 46 } // namespace blink |
47 | 47 |
48 #endif // SimpleContentDecryptionModuleResult_h | 48 #endif // SimpleContentDecryptionModuleResult_h |
OLD | NEW |