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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 continue; | 137 continue; |
138 } | 138 } |
139 | 139 |
140 v8::Local<v8::Object> wrapper = persistent->newLocal(m_isolate); | 140 v8::Local<v8::Object> wrapper = persistent->newLocal(m_isolate); |
141 if (wrapper->CreationContext() == context) | 141 if (wrapper->CreationContext() == context) |
142 return wrapper; | 142 return wrapper; |
143 ++i; | 143 ++i; |
144 } | 144 } |
145 v8::Local<v8::Object> wrapper = holder(m_isolate, context->Global()); | 145 v8::Local<v8::Object> wrapper = holder(m_isolate, context->Global()); |
146 std::unique_ptr<ScopedPersistent<v8::Object>> weakPersistent = | 146 std::unique_ptr<ScopedPersistent<v8::Object>> weakPersistent = |
147 wrapUnique(new ScopedPersistent<v8::Object>); | 147 WTF::wrapUnique(new ScopedPersistent<v8::Object>); |
148 weakPersistent->set(m_isolate, wrapper); | 148 weakPersistent->set(m_isolate, wrapper); |
149 weakPersistent->setPhantom(); | 149 weakPersistent->setPhantom(); |
150 m_wrappers.push_back(std::move(weakPersistent)); | 150 m_wrappers.push_back(std::move(weakPersistent)); |
151 return wrapper; | 151 return wrapper; |
152 } | 152 } |
153 | 153 |
154 void ScriptPromisePropertyBase::clearWrappers() { | 154 void ScriptPromisePropertyBase::clearWrappers() { |
155 checkThis(); | 155 checkThis(); |
156 checkWrappers(); | 156 checkWrappers(); |
157 v8::HandleScope handleScope(m_isolate); | 157 v8::HandleScope handleScope(m_isolate); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 } | 204 } |
205 ASSERT_NOT_REACHED(); | 205 ASSERT_NOT_REACHED(); |
206 return v8::Local<v8::String>(); | 206 return v8::Local<v8::String>(); |
207 } | 207 } |
208 | 208 |
209 DEFINE_TRACE(ScriptPromisePropertyBase) { | 209 DEFINE_TRACE(ScriptPromisePropertyBase) { |
210 ContextLifecycleObserver::trace(visitor); | 210 ContextLifecycleObserver::trace(visitor); |
211 } | 211 } |
212 | 212 |
213 } // namespace blink | 213 } // namespace blink |
OLD | NEW |