| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "modules/compositorworker/CompositorWorkerThread.h" | 5 #include "modules/compositorworker/CompositorWorkerThread.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/ScriptSourceCode.h" | 7 #include "bindings/core/v8/ScriptSourceCode.h" |
| 8 #include "bindings/core/v8/V8GCController.h" | 8 #include "bindings/core/v8/V8GCController.h" |
| 9 #include "core/inspector/ConsoleMessage.h" | 9 #include "core/inspector/ConsoleMessage.h" |
| 10 #include "core/testing/DummyPageHolder.h" | 10 #include "core/testing/DummyPageHolder.h" |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 } | 174 } |
| 175 | 175 |
| 176 bool hasIsolate() const | 176 bool hasIsolate() const |
| 177 { | 177 { |
| 178 return CompositorWorkerThread::hasIsolateForTest(); | 178 return CompositorWorkerThread::hasIsolateForTest(); |
| 179 } | 179 } |
| 180 | 180 |
| 181 private: | 181 private: |
| 182 void executeScriptInWorker(WorkerThread* worker, WaitableEvent* waitEvent) | 182 void executeScriptInWorker(WorkerThread* worker, WaitableEvent* waitEvent) |
| 183 { | 183 { |
| 184 WorkerOrWorkletScriptController* scriptController = worker->workerGlobal
Scope()->script(); | 184 WorkerOrWorkletScriptController* scriptController = worker->workerGlobal
Scope()->scriptController(); |
| 185 bool evaluateResult = scriptController->evaluate(ScriptSourceCode("var c
ounter = 0; ++counter;")); | 185 bool evaluateResult = scriptController->evaluate(ScriptSourceCode("var c
ounter = 0; ++counter;")); |
| 186 ASSERT_UNUSED(evaluateResult, evaluateResult); | 186 ASSERT_UNUSED(evaluateResult, evaluateResult); |
| 187 waitEvent->signal(); | 187 waitEvent->signal(); |
| 188 } | 188 } |
| 189 | 189 |
| 190 OwnPtr<DummyPageHolder> m_page; | 190 OwnPtr<DummyPageHolder> m_page; |
| 191 RefPtr<SecurityOrigin> m_securityOrigin; | 191 RefPtr<SecurityOrigin> m_securityOrigin; |
| 192 OwnPtr<WorkerObjectProxy> m_objectProxy; | 192 OwnPtr<WorkerObjectProxy> m_objectProxy; |
| 193 CompositorWorkerTestPlatform m_testPlatform; | 193 CompositorWorkerTestPlatform m_testPlatform; |
| 194 }; | 194 }; |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 v8::Isolate* secondIsolate = secondWorker->isolate(); | 291 v8::Isolate* secondIsolate = secondWorker->isolate(); |
| 292 ASSERT(secondIsolate); | 292 ASSERT(secondIsolate); |
| 293 EXPECT_EQ(firstIsolate, secondIsolate); | 293 EXPECT_EQ(firstIsolate, secondIsolate); |
| 294 | 294 |
| 295 // Verify that the isolate can run some scripts correctly in the second work
er. | 295 // Verify that the isolate can run some scripts correctly in the second work
er. |
| 296 checkWorkerCanExecuteScript(secondWorker.get()); | 296 checkWorkerCanExecuteScript(secondWorker.get()); |
| 297 secondWorker->terminateAndWait(); | 297 secondWorker->terminateAndWait(); |
| 298 } | 298 } |
| 299 | 299 |
| 300 } // namespace blink | 300 } // namespace blink |
| OLD | NEW |