| 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 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 return; | 120 return; |
| 121 m_rejected = value; | 121 m_rejected = value; |
| 122 resolveOrReject(Rejected); | 122 resolveOrReject(Rejected); |
| 123 } | 123 } |
| 124 | 124 |
| 125 template <typename HolderType, typename ResolvedType, typename RejectedType> | 125 template <typename HolderType, typename ResolvedType, typename RejectedType> |
| 126 v8::Local<v8::Object> | 126 v8::Local<v8::Object> |
| 127 ScriptPromiseProperty<HolderType, ResolvedType, RejectedType>::holder( | 127 ScriptPromiseProperty<HolderType, ResolvedType, RejectedType>::holder( |
| 128 v8::Isolate* isolate, | 128 v8::Isolate* isolate, |
| 129 v8::Local<v8::Object> creationContext) { | 129 v8::Local<v8::Object> creationContext) { |
| 130 v8::Local<v8::Value> value = toV8(m_holder, creationContext, isolate); | 130 v8::Local<v8::Value> value = ToV8(m_holder, creationContext, isolate); |
| 131 if (value.IsEmpty()) | 131 if (value.IsEmpty()) |
| 132 return v8::Local<v8::Object>(); | 132 return v8::Local<v8::Object>(); |
| 133 return value.As<v8::Object>(); | 133 return value.As<v8::Object>(); |
| 134 } | 134 } |
| 135 | 135 |
| 136 template <typename HolderType, typename ResolvedType, typename RejectedType> | 136 template <typename HolderType, typename ResolvedType, typename RejectedType> |
| 137 v8::Local<v8::Value> | 137 v8::Local<v8::Value> |
| 138 ScriptPromiseProperty<HolderType, ResolvedType, RejectedType>::resolvedValue( | 138 ScriptPromiseProperty<HolderType, ResolvedType, RejectedType>::resolvedValue( |
| 139 v8::Isolate* isolate, | 139 v8::Isolate* isolate, |
| 140 v8::Local<v8::Object> creationContext) { | 140 v8::Local<v8::Object> creationContext) { |
| 141 ASSERT(getState() == Resolved); | 141 ASSERT(getState() == Resolved); |
| 142 return toV8(m_resolved, creationContext, isolate); | 142 return ToV8(m_resolved, creationContext, isolate); |
| 143 } | 143 } |
| 144 | 144 |
| 145 template <typename HolderType, typename ResolvedType, typename RejectedType> | 145 template <typename HolderType, typename ResolvedType, typename RejectedType> |
| 146 v8::Local<v8::Value> | 146 v8::Local<v8::Value> |
| 147 ScriptPromiseProperty<HolderType, ResolvedType, RejectedType>::rejectedValue( | 147 ScriptPromiseProperty<HolderType, ResolvedType, RejectedType>::rejectedValue( |
| 148 v8::Isolate* isolate, | 148 v8::Isolate* isolate, |
| 149 v8::Local<v8::Object> creationContext) { | 149 v8::Local<v8::Object> creationContext) { |
| 150 ASSERT(getState() == Rejected); | 150 ASSERT(getState() == Rejected); |
| 151 return toV8(m_rejected, creationContext, isolate); | 151 return ToV8(m_rejected, creationContext, isolate); |
| 152 } | 152 } |
| 153 | 153 |
| 154 template <typename HolderType, typename ResolvedType, typename RejectedType> | 154 template <typename HolderType, typename ResolvedType, typename RejectedType> |
| 155 void ScriptPromiseProperty<HolderType, ResolvedType, RejectedType>::reset() { | 155 void ScriptPromiseProperty<HolderType, ResolvedType, RejectedType>::reset() { |
| 156 resetBase(); | 156 resetBase(); |
| 157 m_resolved = ResolvedType(); | 157 m_resolved = ResolvedType(); |
| 158 m_rejected = RejectedType(); | 158 m_rejected = RejectedType(); |
| 159 } | 159 } |
| 160 | 160 |
| 161 template <typename HolderType, typename ResolvedType, typename RejectedType> | 161 template <typename HolderType, typename ResolvedType, typename RejectedType> |
| (...skipping 13 matching lines...) Expand all Loading... |
| 175 VisitorDispatcher visitor) { | 175 VisitorDispatcher visitor) { |
| 176 TraceIfNeeded<HolderType>::trace(visitor, m_holder); | 176 TraceIfNeeded<HolderType>::trace(visitor, m_holder); |
| 177 TraceIfNeeded<ResolvedType>::trace(visitor, m_resolved); | 177 TraceIfNeeded<ResolvedType>::trace(visitor, m_resolved); |
| 178 TraceIfNeeded<RejectedType>::trace(visitor, m_rejected); | 178 TraceIfNeeded<RejectedType>::trace(visitor, m_rejected); |
| 179 ScriptPromisePropertyBase::trace(visitor); | 179 ScriptPromisePropertyBase::trace(visitor); |
| 180 } | 180 } |
| 181 | 181 |
| 182 } // namespace blink | 182 } // namespace blink |
| 183 | 183 |
| 184 #endif // ScriptPromiseProperty_h | 184 #endif // ScriptPromiseProperty_h |
| OLD | NEW |