| 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 #include "config.h" | 5 #include "config.h" |
| 6 #include "bindings/core/v8/ScriptPromisePropertyBase.h" | 6 #include "bindings/core/v8/ScriptPromisePropertyBase.h" |
| 7 | 7 |
| 8 #include "bindings/core/v8/ScopedPersistent.h" | 8 #include "bindings/core/v8/ScopedPersistent.h" |
| 9 #include "bindings/core/v8/ScriptState.h" | 9 #include "bindings/core/v8/ScriptState.h" |
| 10 #include "bindings/core/v8/V8Binding.h" | 10 #include "bindings/core/v8/V8Binding.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 m_state = Pending; | 105 m_state = Pending; |
| 106 } | 106 } |
| 107 | 107 |
| 108 void ScriptPromisePropertyBase::resolveOrRejectInternal(v8::Handle<v8::Promise::
Resolver> resolver) | 108 void ScriptPromisePropertyBase::resolveOrRejectInternal(v8::Handle<v8::Promise::
Resolver> resolver) |
| 109 { | 109 { |
| 110 switch (m_state) { | 110 switch (m_state) { |
| 111 case Pending: | 111 case Pending: |
| 112 ASSERT_NOT_REACHED(); | 112 ASSERT_NOT_REACHED(); |
| 113 break; | 113 break; |
| 114 case Resolved: | 114 case Resolved: |
| 115 resolver->Resolve(resolvedValue(resolver->CreationContext()->Global(), m
_isolate)); | 115 resolver->Resolve(resolvedValue(m_isolate, resolver->CreationContext()->
Global())); |
| 116 break; | 116 break; |
| 117 case Rejected: | 117 case Rejected: |
| 118 resolver->Reject(rejectedValue(resolver->CreationContext()->Global(), m_
isolate)); | 118 resolver->Reject(rejectedValue(m_isolate, resolver->CreationContext()->G
lobal())); |
| 119 break; | 119 break; |
| 120 } | 120 } |
| 121 } | 121 } |
| 122 | 122 |
| 123 v8::Local<v8::Object> ScriptPromisePropertyBase::ensureHolderWrapper(ScriptState
* scriptState) | 123 v8::Local<v8::Object> ScriptPromisePropertyBase::ensureHolderWrapper(ScriptState
* scriptState) |
| 124 { | 124 { |
| 125 v8::Local<v8::Context> context = scriptState->context(); | 125 v8::Local<v8::Context> context = scriptState->context(); |
| 126 size_t i = 0; | 126 size_t i = 0; |
| 127 while (i < m_wrappers.size()) { | 127 while (i < m_wrappers.size()) { |
| 128 const OwnPtr<ScopedPersistent<v8::Object> >& persistent = m_wrappers[i]; | 128 const OwnPtr<ScopedPersistent<v8::Object> >& persistent = m_wrappers[i]; |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 | 184 |
| 185 SCRIPT_PROMISE_PROPERTIES(P) | 185 SCRIPT_PROMISE_PROPERTIES(P) |
| 186 | 186 |
| 187 #undef P | 187 #undef P |
| 188 } | 188 } |
| 189 ASSERT_NOT_REACHED(); | 189 ASSERT_NOT_REACHED(); |
| 190 return v8::Handle<v8::String>(); | 190 return v8::Handle<v8::String>(); |
| 191 } | 191 } |
| 192 | 192 |
| 193 } // namespace blink | 193 } // namespace blink |
| OLD | NEW |