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

Side by Side Diff: Source/bindings/v8/ScriptPromiseResolverWithContext.h

Issue 350863002: Replaced ToV8Value::toV8Value with V8ValueTraits::toV8Value. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | 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 ScriptPromiseResolverWithContext_h 5 #ifndef ScriptPromiseResolverWithContext_h
6 #define ScriptPromiseResolverWithContext_h 6 #define ScriptPromiseResolverWithContext_h
7 7
8 #include "bindings/v8/ScopedPersistent.h" 8 #include "bindings/v8/ScopedPersistent.h"
9 #include "bindings/v8/ScriptPromise.h" 9 #include "bindings/v8/ScriptPromise.h"
10 #include "bindings/v8/ScriptState.h" 10 #include "bindings/v8/ScriptState.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 ResolvedOrRejected, 97 ResolvedOrRejected,
98 }; 98 };
99 enum LifetimeMode { 99 enum LifetimeMode {
100 Default, 100 Default,
101 KeepAliveWhilePending, 101 KeepAliveWhilePending,
102 }; 102 };
103 103
104 template<typename T> 104 template<typename T>
105 v8::Handle<v8::Value> toV8Value(const T& value) 105 v8::Handle<v8::Value> toV8Value(const T& value)
106 { 106 {
107 return ToV8Value<ScriptPromiseResolverWithContext, v8::Handle<v8::Object > >::toV8Value(value, m_scriptState->context()->Global(), m_scriptState->isolate ()); 107 return V8ValueTraits<T>::toV8Value(value, m_scriptState->context()->Glob al(), m_scriptState->isolate());
108 } 108 }
109 109
110 template <typename T> 110 template <typename T>
111 void resolveOrReject(T value, ResolutionState newState) 111 void resolveOrReject(T value, ResolutionState newState)
112 { 112 {
113 if (m_state != Pending || !executionContext() || executionContext()->act iveDOMObjectsAreStopped()) 113 if (m_state != Pending || !executionContext() || executionContext()->act iveDOMObjectsAreStopped())
114 return; 114 return;
115 ASSERT(newState == Resolving || newState == Rejecting); 115 ASSERT(newState == Resolving || newState == Rejecting);
116 m_state = newState; 116 m_state = newState;
117 // Retain this object until it is actually resolved or rejected. 117 // Retain this object until it is actually resolved or rejected.
(...skipping 18 matching lines...) Expand all
136 ScopedPersistent<v8::Value> m_value; 136 ScopedPersistent<v8::Value> m_value;
137 #if ASSERT_ENABLED 137 #if ASSERT_ENABLED
138 // True if promise() is called. 138 // True if promise() is called.
139 bool m_isPromiseCalled; 139 bool m_isPromiseCalled;
140 #endif 140 #endif
141 }; 141 };
142 142
143 } // namespace WebCore 143 } // namespace WebCore
144 144
145 #endif // #ifndef ScriptPromiseResolverWithContext_h 145 #endif // #ifndef ScriptPromiseResolverWithContext_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698