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 "bindings/core/v8/ScriptPromisePropertyBase.h" | 5 #include "bindings/core/v8/ScriptPromisePropertyBase.h" |
6 | 6 |
7 #include "bindings/core/v8/ScopedPersistent.h" | 7 #include "bindings/core/v8/ScopedPersistent.h" |
8 #include "bindings/core/v8/ScriptState.h" | 8 #include "bindings/core/v8/ScriptState.h" |
9 #include "bindings/core/v8/V8Binding.h" | 9 #include "bindings/core/v8/V8Binding.h" |
10 #include "bindings/core/v8/V8HiddenValue.h" | 10 #include "bindings/core/v8/V8HiddenValue.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 } | 108 } |
109 | 109 |
110 void ScriptPromisePropertyBase::resolveOrRejectInternal( | 110 void ScriptPromisePropertyBase::resolveOrRejectInternal( |
111 v8::Local<v8::Promise::Resolver> resolver) { | 111 v8::Local<v8::Promise::Resolver> resolver) { |
112 v8::Local<v8::Context> context = resolver->CreationContext(); | 112 v8::Local<v8::Context> context = resolver->CreationContext(); |
113 switch (m_state) { | 113 switch (m_state) { |
114 case Pending: | 114 case Pending: |
115 ASSERT_NOT_REACHED(); | 115 ASSERT_NOT_REACHED(); |
116 break; | 116 break; |
117 case Resolved: | 117 case Resolved: |
118 resolver->Resolve(context, resolvedValue(m_isolate, context->Global())); | 118 resolver->Resolve(context, resolvedValue( |
| 119 m_isolate, context->Global())).ToChecked(); |
119 break; | 120 break; |
120 case Rejected: | 121 case Rejected: |
121 resolver->Reject(context, rejectedValue(m_isolate, context->Global())); | 122 resolver->Reject(context, rejectedValue( |
| 123 m_isolate, context->Global())).ToChecked(); |
122 break; | 124 break; |
123 } | 125 } |
124 } | 126 } |
125 | 127 |
126 v8::Local<v8::Object> ScriptPromisePropertyBase::ensureHolderWrapper( | 128 v8::Local<v8::Object> ScriptPromisePropertyBase::ensureHolderWrapper( |
127 ScriptState* scriptState) { | 129 ScriptState* scriptState) { |
128 v8::Local<v8::Context> context = scriptState->context(); | 130 v8::Local<v8::Context> context = scriptState->context(); |
129 size_t i = 0; | 131 size_t i = 0; |
130 while (i < m_wrappers.size()) { | 132 while (i < m_wrappers.size()) { |
131 const std::unique_ptr<ScopedPersistent<v8::Object>>& persistent = | 133 const std::unique_ptr<ScopedPersistent<v8::Object>>& persistent = |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 } | 208 } |
207 ASSERT_NOT_REACHED(); | 209 ASSERT_NOT_REACHED(); |
208 return v8::Local<v8::String>(); | 210 return v8::Local<v8::String>(); |
209 } | 211 } |
210 | 212 |
211 DEFINE_TRACE(ScriptPromisePropertyBase) { | 213 DEFINE_TRACE(ScriptPromisePropertyBase) { |
212 ContextClient::trace(visitor); | 214 ContextClient::trace(visitor); |
213 } | 215 } |
214 | 216 |
215 } // namespace blink | 217 } // namespace blink |
OLD | NEW |