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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 // we can't move this check out of the loop. | 135 // we can't move this check out of the loop. |
136 m_wrappers.remove(i); | 136 m_wrappers.remove(i); |
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(context->Global(), m_isolate); | 145 v8::Local<v8::Object> wrapper = holder(m_isolate, context->Global()); |
146 OwnPtr<ScopedPersistent<v8::Object>> weakPersistent = adoptPtr(new ScopedPer
sistent<v8::Object>); | 146 OwnPtr<ScopedPersistent<v8::Object>> weakPersistent = adoptPtr(new ScopedPer
sistent<v8::Object>); |
147 weakPersistent->set(m_isolate, wrapper); | 147 weakPersistent->set(m_isolate, wrapper); |
148 weakPersistent->setWeak(weakPersistent.get(), &clearHandle); | 148 weakPersistent->setWeak(weakPersistent.get(), &clearHandle); |
149 m_wrappers.append(weakPersistent.release()); | 149 m_wrappers.append(weakPersistent.release()); |
150 return wrapper; | 150 return wrapper; |
151 } | 151 } |
152 | 152 |
153 void ScriptPromisePropertyBase::clearWrappers() | 153 void ScriptPromisePropertyBase::clearWrappers() |
154 { | 154 { |
155 v8::HandleScope handleScope(m_isolate); | 155 v8::HandleScope handleScope(m_isolate); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 ASSERT_NOT_REACHED(); | 192 ASSERT_NOT_REACHED(); |
193 return v8::Handle<v8::String>(); | 193 return v8::Handle<v8::String>(); |
194 } | 194 } |
195 | 195 |
196 DEFINE_TRACE(ScriptPromisePropertyBase) | 196 DEFINE_TRACE(ScriptPromisePropertyBase) |
197 { | 197 { |
198 ContextLifecycleObserver::trace(visitor); | 198 ContextLifecycleObserver::trace(visitor); |
199 } | 199 } |
200 | 200 |
201 } // namespace blink | 201 } // namespace blink |
OLD | NEW |