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/ScriptPromiseProperty.h" | 6 #include "bindings/core/v8/ScriptPromiseProperty.h" |
7 | 7 |
8 #include "bindings/core/v8/DOMWrapperWorld.h" | 8 #include "bindings/core/v8/DOMWrapperWorld.h" |
9 #include "bindings/core/v8/ScriptFunction.h" | 9 #include "bindings/core/v8/ScriptFunction.h" |
10 #include "bindings/core/v8/ScriptPromise.h" | 10 #include "bindings/core/v8/ScriptPromise.h" |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 DOMWrapperWorld& mainWorld() { return mainScriptState()->world(); } | 142 DOMWrapperWorld& mainWorld() { return mainScriptState()->world(); } |
143 ScriptState* otherScriptState() { return m_otherScriptState.get(); } | 143 ScriptState* otherScriptState() { return m_otherScriptState.get(); } |
144 DOMWrapperWorld& otherWorld() { return m_otherScriptState->world(); } | 144 DOMWrapperWorld& otherWorld() { return m_otherScriptState->world(); } |
145 ScriptState* currentScriptState() { return ScriptState::current(isolate());
} | 145 ScriptState* currentScriptState() { return ScriptState::current(isolate());
} |
146 | 146 |
147 virtual void destroyContext() | 147 virtual void destroyContext() |
148 { | 148 { |
149 m_page.clear(); | 149 m_page.clear(); |
150 m_otherScriptState.clear(); | 150 m_otherScriptState.clear(); |
151 gc(); | 151 gc(); |
152 Heap::collectGarbage(ThreadState::HeapPointersOnStack, ThreadState::GCWi
thSweep, Heap::ForcedGCForTesting); | 152 Heap::collectGarbage(ThreadState::HeapPointersOnStack, ThreadState::GCWi
thSweep, Heap::ForcedGC); |
153 } | 153 } |
154 | 154 |
155 void gc() { V8GCController::collectGarbage(v8::Isolate::GetCurrent()); } | 155 void gc() { V8GCController::collectGarbage(v8::Isolate::GetCurrent()); } |
156 | 156 |
157 v8::Handle<v8::Function> notReached(ScriptState* scriptState) { return NotRe
ached::createFunction(scriptState); } | 157 v8::Handle<v8::Function> notReached(ScriptState* scriptState) { return NotRe
ached::createFunction(scriptState); } |
158 v8::Handle<v8::Function> stub(ScriptState* scriptState, ScriptValue& value,
size_t& callCount) { return StubFunction::createFunction(scriptState, value, cal
lCount); } | 158 v8::Handle<v8::Function> stub(ScriptState* scriptState, ScriptValue& value,
size_t& callCount) { return StubFunction::createFunction(scriptState, value, cal
lCount); } |
159 | 159 |
160 template <typename T> | 160 template <typename T> |
161 ScriptValue wrap(DOMWrapperWorld& world, const T& value) | 161 ScriptValue wrap(DOMWrapperWorld& world, const T& value) |
162 { | 162 { |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 { | 546 { |
547 test(String("hello"), "hello", __FILE__, __LINE__); | 547 test(String("hello"), "hello", __FILE__, __LINE__); |
548 } | 548 } |
549 | 549 |
550 TEST_F(ScriptPromisePropertyNonScriptWrappableResolutionTargetTest, ResolveWithI
nteger) | 550 TEST_F(ScriptPromisePropertyNonScriptWrappableResolutionTargetTest, ResolveWithI
nteger) |
551 { | 551 { |
552 test(-1, "-1", __FILE__, __LINE__); | 552 test(-1, "-1", __FILE__, __LINE__); |
553 } | 553 } |
554 | 554 |
555 } // namespace | 555 } // namespace |
OLD | NEW |