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

Side by Side Diff: third_party/WebKit/Source/modules/encryptedmedia/ContentDecryptionModuleResultPromise.h

Issue 2056053003: Change MediaKeys.setServerCertificate() to return Promise<boolean> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: resolve false Created 4 years, 6 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
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 #ifndef ContentDecryptionModuleResultPromise_h 5 #ifndef ContentDecryptionModuleResultPromise_h
6 #define ContentDecryptionModuleResultPromise_h 6 #define ContentDecryptionModuleResultPromise_h
7 7
8 #include "bindings/core/v8/ScriptPromiseResolver.h" 8 #include "bindings/core/v8/ScriptPromiseResolver.h"
9 #include "core/dom/ExceptionCode.h" 9 #include "core/dom/ExceptionCode.h"
10 #include "platform/ContentDecryptionModuleResult.h" 10 #include "platform/ContentDecryptionModuleResult.h"
11 11
12 namespace blink { 12 namespace blink {
13 13
14 ExceptionCode WebCdmExceptionToExceptionCode(WebContentDecryptionModuleException ); 14 ExceptionCode WebCdmExceptionToExceptionCode(WebContentDecryptionModuleException );
15 15
16 // This class wraps the promise resolver to simplify creation of 16 // This class wraps the promise resolver to simplify creation of
17 // ContentDecryptionModuleResult objects. The default implementations of the 17 // ContentDecryptionModuleResult objects. The default implementations of the
18 // complete(), completeWithSession(), etc. methods will reject the promise 18 // complete(), completeWithSession(), etc. methods will reject the promise
19 // with an error. It needs to be subclassed and the appropriate complete() 19 // with an error. It needs to be subclassed and the appropriate complete()
20 // method overridden to resolve the promise as needed. 20 // method overridden to resolve the promise as needed.
21 class ContentDecryptionModuleResultPromise : public ContentDecryptionModuleResul t { 21 class ContentDecryptionModuleResultPromise : public ContentDecryptionModuleResul t {
22 public: 22 public:
23 ~ContentDecryptionModuleResultPromise() override; 23 ~ContentDecryptionModuleResultPromise() override;
24 24
25 // ContentDecryptionModuleResult implementation. 25 // ContentDecryptionModuleResult implementation.
26 void complete() override; 26 void complete() override;
27 void completeWithContentDecryptionModule(WebContentDecryptionModule*) overri de; 27 void completeWithContentDecryptionModule(WebContentDecryptionModule*) overri de;
28 void completeWithSession(WebContentDecryptionModuleResult::SessionStatus) ov erride; 28 void completeWithSession(WebContentDecryptionModuleResult::SessionStatus) ov erride;
29 void completeWithError(WebContentDecryptionModuleException, unsigned long sy stemCode, const WebString&) final; 29 void completeWithError(WebContentDecryptionModuleException, unsigned long sy stemCode, const WebString&) override;
30 30
31 // It is only valid to call this before completion. 31 // It is only valid to call this before completion.
32 ScriptPromise promise(); 32 ScriptPromise promise();
33 33
34 DECLARE_VIRTUAL_TRACE(); 34 DECLARE_VIRTUAL_TRACE();
35 35
36 protected: 36 protected:
37 explicit ContentDecryptionModuleResultPromise(ScriptState*); 37 explicit ContentDecryptionModuleResultPromise(ScriptState*);
38 38
39 // Resolves the promise with |value|. Used by subclasses to resolve the 39 // Resolves the promise with |value|. Used by subclasses to resolve the
(...skipping 10 matching lines...) Expand all
50 50
51 ExecutionContext* getExecutionContext() const; 51 ExecutionContext* getExecutionContext() const;
52 52
53 private: 53 private:
54 Member<ScriptPromiseResolver> m_resolver; 54 Member<ScriptPromiseResolver> m_resolver;
55 }; 55 };
56 56
57 } // namespace blink 57 } // namespace blink
58 58
59 #endif // ContentDecryptionModuleResultPromise_h 59 #endif // ContentDecryptionModuleResultPromise_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698