OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 { | 167 { |
168 if (m_resolver.isEmpty()) | 168 if (m_resolver.isEmpty()) |
169 return v8::Local<v8::Promise>(); | 169 return v8::Local<v8::Promise>(); |
170 return m_resolver.v8Value().As<v8::Promise::Resolver>()->GetPromise(); | 170 return m_resolver.v8Value().As<v8::Promise::Resolver>()->GetPromise(); |
171 } | 171 } |
172 | 172 |
173 ScriptPromise ScriptPromise::InternalResolver::promise() const | 173 ScriptPromise ScriptPromise::InternalResolver::promise() const |
174 { | 174 { |
175 if (m_resolver.isEmpty()) | 175 if (m_resolver.isEmpty()) |
176 return ScriptPromise(); | 176 return ScriptPromise(); |
177 return ScriptPromise(m_resolver.scriptState(), v8Promise()); | 177 return ScriptPromise(m_resolver.getScriptState(), v8Promise()); |
178 } | 178 } |
179 | 179 |
180 void ScriptPromise::InternalResolver::resolve(v8::Local<v8::Value> value) | 180 void ScriptPromise::InternalResolver::resolve(v8::Local<v8::Value> value) |
181 { | 181 { |
182 if (m_resolver.isEmpty()) | 182 if (m_resolver.isEmpty()) |
183 return; | 183 return; |
184 m_resolver.v8Value().As<v8::Promise::Resolver>()->Resolve(m_resolver.context
(), value); | 184 m_resolver.v8Value().As<v8::Promise::Resolver>()->Resolve(m_resolver.context
(), value); |
185 clear(); | 185 clear(); |
186 } | 186 } |
187 | 187 |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 InstanceCounters::incrementCounter(InstanceCounters::ScriptPromiseCounte
r); | 316 InstanceCounters::incrementCounter(InstanceCounters::ScriptPromiseCounte
r); |
317 } | 317 } |
318 | 318 |
319 void ScriptPromise::decreaseInstanceCount() | 319 void ScriptPromise::decreaseInstanceCount() |
320 { | 320 { |
321 if (isMainThread()) | 321 if (isMainThread()) |
322 InstanceCounters::decrementCounter(InstanceCounters::ScriptPromiseCounte
r); | 322 InstanceCounters::decrementCounter(InstanceCounters::ScriptPromiseCounte
r); |
323 } | 323 } |
324 | 324 |
325 } // namespace blink | 325 } // namespace blink |
OLD | NEW |