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

Side by Side Diff: Source/bindings/core/v8/ScriptPromiseProperty.h

Issue 1236473002: Fix virtual/override/final usage in Source/bindings/. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 5 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 ScriptPromiseProperty_h 5 #ifndef ScriptPromiseProperty_h
6 #define ScriptPromiseProperty_h 6 #define ScriptPromiseProperty_h
7 7
8 #include "bindings/core/v8/ScriptPromise.h" 8 #include "bindings/core/v8/ScriptPromise.h"
9 #include "bindings/core/v8/ScriptPromisePropertyBase.h" 9 #include "bindings/core/v8/ScriptPromisePropertyBase.h"
10 #include "bindings/core/v8/ToV8.h" 10 #include "bindings/core/v8/ToV8.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 // (typically ScriptPromiseProperty should be a member of the 47 // (typically ScriptPromiseProperty should be a member of the
48 // property holder). 48 // property holder).
49 // 49 //
50 // When implementing a ScriptPromiseProperty add the property name 50 // When implementing a ScriptPromiseProperty add the property name
51 // to ScriptPromiseProperties.h and pass 51 // to ScriptPromiseProperties.h and pass
52 // ScriptPromiseProperty::Foo to create. The name must be unique 52 // ScriptPromiseProperty::Foo to create. The name must be unique
53 // per kind of holder. 53 // per kind of holder.
54 template<typename PassHolderType> 54 template<typename PassHolderType>
55 ScriptPromiseProperty(ExecutionContext*, PassHolderType, Name); 55 ScriptPromiseProperty(ExecutionContext*, PassHolderType, Name);
56 56
57 virtual ~ScriptPromiseProperty() { } 57 ~ScriptPromiseProperty() override { }
58 58
59 template<typename PassResolvedType> 59 template<typename PassResolvedType>
60 void resolve(PassResolvedType); 60 void resolve(PassResolvedType);
61 61
62 template<typename PassRejectedType> 62 template<typename PassRejectedType>
63 void reject(PassRejectedType); 63 void reject(PassRejectedType);
64 64
65 // Resets this property by unregistering the Promise property from the 65 // Resets this property by unregistering the Promise property from the
66 // holder wrapper. Resets the internal state to Pending and clears the 66 // holder wrapper. Resets the internal state to Pending and clears the
67 // resolved and the rejected values. 67 // resolved and the rejected values.
68 // This method keeps the holder object and the property name. 68 // This method keeps the holder object and the property name.
69 void reset(); 69 void reset();
70 70
71 DECLARE_VIRTUAL_TRACE(); 71 DECLARE_VIRTUAL_TRACE();
72 72
73 private: 73 private:
74 virtual v8::Local<v8::Object> holder(v8::Isolate*, v8::Local<v8::Object> cre ationContext) override; 74 v8::Local<v8::Object> holder(v8::Isolate*, v8::Local<v8::Object> creationCon text) override;
75 virtual v8::Local<v8::Value> resolvedValue(v8::Isolate*, v8::Local<v8::Objec t> creationContext) override; 75 v8::Local<v8::Value> resolvedValue(v8::Isolate*, v8::Local<v8::Object> creat ionContext) override;
76 virtual v8::Local<v8::Value> rejectedValue(v8::Isolate*, v8::Local<v8::Objec t> creationContext) override; 76 v8::Local<v8::Value> rejectedValue(v8::Isolate*, v8::Local<v8::Object> creat ionContext) override;
77 77
78 HolderType m_holder; 78 HolderType m_holder;
79 ResolvedType m_resolved; 79 ResolvedType m_resolved;
80 RejectedType m_rejected; 80 RejectedType m_rejected;
81 }; 81 };
82 82
83 template<typename HolderType, typename ResolvedType, typename RejectedType> 83 template<typename HolderType, typename ResolvedType, typename RejectedType>
84 template<typename PassHolderType> 84 template<typename PassHolderType>
85 ScriptPromiseProperty<HolderType, ResolvedType, RejectedType>::ScriptPromiseProp erty(ExecutionContext* executionContext, PassHolderType holder, Name name) 85 ScriptPromiseProperty<HolderType, ResolvedType, RejectedType>::ScriptPromiseProp erty(ExecutionContext* executionContext, PassHolderType holder, Name name)
86 : ScriptPromisePropertyBase(executionContext, name) 86 : ScriptPromisePropertyBase(executionContext, name)
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 { 158 {
159 TraceIfNeeded<HolderType>::trace(visitor, m_holder); 159 TraceIfNeeded<HolderType>::trace(visitor, m_holder);
160 TraceIfNeeded<ResolvedType>::trace(visitor, m_resolved); 160 TraceIfNeeded<ResolvedType>::trace(visitor, m_resolved);
161 TraceIfNeeded<RejectedType>::trace(visitor, m_rejected); 161 TraceIfNeeded<RejectedType>::trace(visitor, m_rejected);
162 ScriptPromisePropertyBase::trace(visitor); 162 ScriptPromisePropertyBase::trace(visitor);
163 } 163 }
164 164
165 } // namespace blink 165 } // namespace blink
166 166
167 #endif // ScriptPromiseProperty_h 167 #endif // ScriptPromiseProperty_h
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/ScriptProfiler.cpp ('k') | Source/bindings/core/v8/ScriptPromisePropertyTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698