| 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 <memory> | 7 #include <memory> |
| 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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 } | 154 } |
| 155 | 155 |
| 156 void ScriptPromisePropertyBase::ClearWrappers() { | 156 void ScriptPromisePropertyBase::ClearWrappers() { |
| 157 CheckThis(); | 157 CheckThis(); |
| 158 CheckWrappers(); | 158 CheckWrappers(); |
| 159 v8::HandleScope handle_scope(isolate_); | 159 v8::HandleScope handle_scope(isolate_); |
| 160 for (WeakPersistentSet::iterator i = wrappers_.begin(); i != wrappers_.end(); | 160 for (WeakPersistentSet::iterator i = wrappers_.begin(); i != wrappers_.end(); |
| 161 ++i) { | 161 ++i) { |
| 162 v8::Local<v8::Object> wrapper = (*i)->NewLocal(isolate_); | 162 v8::Local<v8::Object> wrapper = (*i)->NewLocal(isolate_); |
| 163 if (!wrapper.IsEmpty()) { | 163 if (!wrapper.IsEmpty()) { |
| 164 ResolverSymbol().DeleteProperty(wrapper); | |
| 165 // TODO(peria): Use deleteProperty() if http://crbug.com/v8/6227 is fixed. | 164 // TODO(peria): Use deleteProperty() if http://crbug.com/v8/6227 is fixed. |
| 165 ResolverSymbol().Set(wrapper, v8::Undefined(isolate_)); |
| 166 PromiseSymbol().Set(wrapper, v8::Undefined(isolate_)); | 166 PromiseSymbol().Set(wrapper, v8::Undefined(isolate_)); |
| 167 } | 167 } |
| 168 } | 168 } |
| 169 wrappers_.Clear(); | 169 wrappers_.Clear(); |
| 170 } | 170 } |
| 171 | 171 |
| 172 void ScriptPromisePropertyBase::CheckThis() { | 172 void ScriptPromisePropertyBase::CheckThis() { |
| 173 RELEASE_ASSERT(this); | 173 RELEASE_ASSERT(this); |
| 174 } | 174 } |
| 175 | 175 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 } | 208 } |
| 209 NOTREACHED(); | 209 NOTREACHED(); |
| 210 return V8PrivateProperty::GetSymbol(isolate_, "noResolver"); | 210 return V8PrivateProperty::GetSymbol(isolate_, "noResolver"); |
| 211 } | 211 } |
| 212 | 212 |
| 213 DEFINE_TRACE(ScriptPromisePropertyBase) { | 213 DEFINE_TRACE(ScriptPromisePropertyBase) { |
| 214 ContextClient::Trace(visitor); | 214 ContextClient::Trace(visitor); |
| 215 } | 215 } |
| 216 | 216 |
| 217 } // namespace blink | 217 } // namespace blink |
| OLD | NEW |