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

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

Issue 683733003: Move the v8::Isolate* parameter to the first parameter of various binding methods in third_party/We… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « no previous file | Source/bindings/core/v8/ScriptPromisePropertyBase.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/V8Binding.h" 10 #include "bindings/core/v8/V8Binding.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 virtual void trace(Visitor*) override; 71 virtual void trace(Visitor*) override;
72 72
73 private: 73 private:
74 virtual v8::Handle<v8::Object> holder(v8::Handle<v8::Object> creationContext , v8::Isolate*) override; 74 virtual v8::Handle<v8::Object> holder(v8::Handle<v8::Object> creationContext , v8::Isolate*) override;
75 virtual v8::Handle<v8::Value> resolvedValue(v8::Handle<v8::Object> creationC ontext, v8::Isolate*) override; 75 virtual v8::Handle<v8::Value> resolvedValue(v8::Isolate*, v8::Handle<v8::Obj ect> creationContext) override;
76 virtual v8::Handle<v8::Value> rejectedValue(v8::Handle<v8::Object> creationC ontext, v8::Isolate*) override; 76 virtual v8::Handle<v8::Value> rejectedValue(v8::Isolate*, v8::Handle<v8::Obj ect> creationContext) 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 30 matching lines...) Expand all
117 } 117 }
118 118
119 template<typename HolderType, typename ResolvedType, typename RejectedType> 119 template<typename HolderType, typename ResolvedType, typename RejectedType>
120 v8::Handle<v8::Object> ScriptPromiseProperty<HolderType, ResolvedType, RejectedT ype>::holder(v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) 120 v8::Handle<v8::Object> ScriptPromiseProperty<HolderType, ResolvedType, RejectedT ype>::holder(v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
121 { 121 {
122 v8::Handle<v8::Value> value = V8ValueTraits<HolderType>::toV8Value(m_holder, creationContext, isolate); 122 v8::Handle<v8::Value> value = V8ValueTraits<HolderType>::toV8Value(m_holder, creationContext, isolate);
123 return value.As<v8::Object>(); 123 return value.As<v8::Object>();
124 } 124 }
125 125
126 template<typename HolderType, typename ResolvedType, typename RejectedType> 126 template<typename HolderType, typename ResolvedType, typename RejectedType>
127 v8::Handle<v8::Value> ScriptPromiseProperty<HolderType, ResolvedType, RejectedTy pe>::resolvedValue(v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) 127 v8::Handle<v8::Value> ScriptPromiseProperty<HolderType, ResolvedType, RejectedTy pe>::resolvedValue(v8::Isolate* isolate, v8::Handle<v8::Object> creationContext)
128 { 128 {
129 ASSERT(state() == Resolved); 129 ASSERT(state() == Resolved);
130 return V8ValueTraits<ResolvedType>::toV8Value(m_resolved, creationContext, i solate); 130 return V8ValueTraits<ResolvedType>::toV8Value(m_resolved, creationContext, i solate);
131 } 131 }
132 132
133 template<typename HolderType, typename ResolvedType, typename RejectedType> 133 template<typename HolderType, typename ResolvedType, typename RejectedType>
134 v8::Handle<v8::Value> ScriptPromiseProperty<HolderType, ResolvedType, RejectedTy pe>::rejectedValue(v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) 134 v8::Handle<v8::Value> ScriptPromiseProperty<HolderType, ResolvedType, RejectedTy pe>::rejectedValue(v8::Isolate* isolate, v8::Handle<v8::Object> creationContext)
135 { 135 {
136 ASSERT(state() == Rejected); 136 ASSERT(state() == Rejected);
137 return V8ValueTraits<RejectedType>::toV8Value(m_rejected, creationContext, i solate); 137 return V8ValueTraits<RejectedType>::toV8Value(m_rejected, creationContext, i solate);
138 } 138 }
139 139
140 template<typename HolderType, typename ResolvedType, typename RejectedType> 140 template<typename HolderType, typename ResolvedType, typename RejectedType>
141 void ScriptPromiseProperty<HolderType, ResolvedType, RejectedType>::reset() 141 void ScriptPromiseProperty<HolderType, ResolvedType, RejectedType>::reset()
142 { 142 {
143 resetBase(); 143 resetBase();
144 m_resolved = ResolvedType(); 144 m_resolved = ResolvedType();
145 m_rejected = RejectedType(); 145 m_rejected = RejectedType();
146 } 146 }
147 147
148 template<typename HolderType, typename ResolvedType, typename RejectedType> 148 template<typename HolderType, typename ResolvedType, typename RejectedType>
149 void ScriptPromiseProperty<HolderType, ResolvedType, RejectedType>::trace(Visito r* visitor) 149 void ScriptPromiseProperty<HolderType, ResolvedType, RejectedType>::trace(Visito r* visitor)
150 { 150 {
151 TraceIfNeeded<HolderType>::trace(visitor, &m_holder); 151 TraceIfNeeded<HolderType>::trace(visitor, &m_holder);
152 TraceIfNeeded<ResolvedType>::trace(visitor, &m_resolved); 152 TraceIfNeeded<ResolvedType>::trace(visitor, &m_resolved);
153 TraceIfNeeded<RejectedType>::trace(visitor, &m_rejected); 153 TraceIfNeeded<RejectedType>::trace(visitor, &m_rejected);
154 ScriptPromisePropertyBase::trace(visitor); 154 ScriptPromisePropertyBase::trace(visitor);
155 } 155 }
156 156
157 } // namespace blink 157 } // namespace blink
158 158
159 #endif // ScriptPromiseProperty_h 159 #endif // ScriptPromiseProperty_h
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/core/v8/ScriptPromisePropertyBase.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698