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

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

Issue 949093002: InlinedVisitor: Migrate encryptedmedia to use inlined tracing (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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 | Annotate | Revision Log
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"
(...skipping 13 matching lines...) Expand all
24 24
25 // ContentDecryptionModuleResult implementation. 25 // ContentDecryptionModuleResult implementation.
26 virtual void complete() override; 26 virtual void complete() override;
27 virtual void completeWithContentDecryptionModule(WebContentDecryptionModule* ) override; 27 virtual void completeWithContentDecryptionModule(WebContentDecryptionModule* ) override;
28 virtual void completeWithSession(WebContentDecryptionModuleResult::SessionSt atus) override; 28 virtual void completeWithSession(WebContentDecryptionModuleResult::SessionSt atus) override;
29 virtual void completeWithError(WebContentDecryptionModuleException, unsigned long systemCode, const WebString&) final; 29 virtual void completeWithError(WebContentDecryptionModuleException, unsigned long systemCode, const WebString&) final;
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 virtual void trace(Visitor*); 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
40 // promise. 40 // promise.
41 template <typename... T> 41 template <typename... T>
42 void resolve(T... value) 42 void resolve(T... value)
43 { 43 {
44 m_resolver->resolve(value...); 44 m_resolver->resolve(value...);
45 m_resolver.clear(); 45 m_resolver.clear();
46 } 46 }
47 47
48 // Rejects the promise with a DOMException. 48 // Rejects the promise with a DOMException.
49 void reject(ExceptionCode, const String& errorMessage); 49 void reject(ExceptionCode, const String& errorMessage);
50 50
51 ExecutionContext* executionContext() const; 51 ExecutionContext* executionContext() const;
52 52
53 private: 53 private:
54 RefPtrWillBeMember<ScriptPromiseResolver> m_resolver; 54 RefPtrWillBeMember<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