| 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/ScriptPromiseProperty.h" | 5 #include "bindings/core/v8/ScriptPromiseProperty.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/DOMWrapperWorld.h" | 7 #include "bindings/core/v8/DOMWrapperWorld.h" |
| 8 #include "bindings/core/v8/ScriptFunction.h" | 8 #include "bindings/core/v8/ScriptFunction.h" |
| 9 #include "bindings/core/v8/ScriptPromise.h" | 9 #include "bindings/core/v8/ScriptPromise.h" |
| 10 #include "bindings/core/v8/ScriptState.h" | 10 #include "bindings/core/v8/ScriptState.h" |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 Document& document() { return m_page->document(); } | 115 Document& document() { return m_page->document(); } |
| 116 v8::Isolate* isolate() { return toIsolate(&document()); } | 116 v8::Isolate* isolate() { return toIsolate(&document()); } |
| 117 ScriptState* mainScriptState() { return ScriptState::forMainWorld(document()
.frame()); } | 117 ScriptState* mainScriptState() { return ScriptState::forMainWorld(document()
.frame()); } |
| 118 DOMWrapperWorld& mainWorld() { return mainScriptState()->world(); } | 118 DOMWrapperWorld& mainWorld() { return mainScriptState()->world(); } |
| 119 ScriptState* otherScriptState() { return m_otherScriptState.get(); } | 119 ScriptState* otherScriptState() { return m_otherScriptState.get(); } |
| 120 DOMWrapperWorld& otherWorld() { return m_otherScriptState->world(); } | 120 DOMWrapperWorld& otherWorld() { return m_otherScriptState->world(); } |
| 121 ScriptState* currentScriptState() { return ScriptState::current(isolate());
} | 121 ScriptState* currentScriptState() { return ScriptState::current(isolate());
} |
| 122 | 122 |
| 123 void destroyContext() | 123 void destroyContext() |
| 124 { | 124 { |
| 125 m_page.clear(); | 125 m_page.reset(); |
| 126 if (m_otherScriptState) { | 126 if (m_otherScriptState) { |
| 127 m_otherScriptState->disposePerContextData(); | 127 m_otherScriptState->disposePerContextData(); |
| 128 m_otherScriptState = nullptr; | 128 m_otherScriptState = nullptr; |
| 129 } | 129 } |
| 130 } | 130 } |
| 131 | 131 |
| 132 void gc() { V8GCController::collectAllGarbageForTesting(v8::Isolate::GetCurr
ent()); } | 132 void gc() { V8GCController::collectAllGarbageForTesting(v8::Isolate::GetCurr
ent()); } |
| 133 | 133 |
| 134 v8::Local<v8::Function> notReached(ScriptState* scriptState) { return NotRea
ched::createFunction(scriptState); } | 134 v8::Local<v8::Function> notReached(ScriptState* scriptState) { return NotRea
ched::createFunction(scriptState); } |
| 135 v8::Local<v8::Function> stub(ScriptState* scriptState, ScriptValue& value, s
ize_t& callCount) { return StubFunction::createFunction(scriptState, value, call
Count); } | 135 v8::Local<v8::Function> stub(ScriptState* scriptState, ScriptValue& value, s
ize_t& callCount) { return StubFunction::createFunction(scriptState, value, call
Count); } |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 { | 431 { |
| 432 test(String("hello"), "hello", __FILE__, __LINE__); | 432 test(String("hello"), "hello", __FILE__, __LINE__); |
| 433 } | 433 } |
| 434 | 434 |
| 435 TEST_F(ScriptPromisePropertyNonScriptWrappableResolutionTargetTest, ResolveWithI
nteger) | 435 TEST_F(ScriptPromisePropertyNonScriptWrappableResolutionTargetTest, ResolveWithI
nteger) |
| 436 { | 436 { |
| 437 test(-1, "-1", __FILE__, __LINE__); | 437 test(-1, "-1", __FILE__, __LINE__); |
| 438 } | 438 } |
| 439 | 439 |
| 440 } // namespace | 440 } // namespace |
| OLD | NEW |