| 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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 } | 181 } |
| 182 | 182 |
| 183 bool hasIsolate() const | 183 bool hasIsolate() const |
| 184 { | 184 { |
| 185 return CompositorWorkerThread::hasIsolateForTest(); | 185 return CompositorWorkerThread::hasIsolateForTest(); |
| 186 } | 186 } |
| 187 | 187 |
| 188 private: | 188 private: |
| 189 void executeScriptInWorker(WorkerThread* worker, WebWaitableEvent* waitEvent
) | 189 void executeScriptInWorker(WorkerThread* worker, WebWaitableEvent* waitEvent
) |
| 190 { | 190 { |
| 191 WorkerScriptController* scriptController = worker->workerGlobalScope()->
script(); | 191 IsolatedScriptController* scriptController = worker->workerGlobalScope()
->script(); |
| 192 bool evaluateResult = scriptController->evaluate(ScriptSourceCode("var c
ounter = 0; ++counter;")); | 192 bool evaluateResult = scriptController->evaluate(ScriptSourceCode("var c
ounter = 0; ++counter;")); |
| 193 ASSERT_UNUSED(evaluateResult, evaluateResult); | 193 ASSERT_UNUSED(evaluateResult, evaluateResult); |
| 194 waitEvent->signal(); | 194 waitEvent->signal(); |
| 195 } | 195 } |
| 196 | 196 |
| 197 OwnPtr<DummyPageHolder> m_page; | 197 OwnPtr<DummyPageHolder> m_page; |
| 198 RefPtr<SecurityOrigin> m_securityOrigin; | 198 RefPtr<SecurityOrigin> m_securityOrigin; |
| 199 OwnPtr<WorkerObjectProxy> m_objectProxy; | 199 OwnPtr<WorkerObjectProxy> m_objectProxy; |
| 200 CompositorWorkerTestPlatform m_testPlatform; | 200 CompositorWorkerTestPlatform m_testPlatform; |
| 201 }; | 201 }; |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 v8::Isolate* secondIsolate = secondWorker->isolate(); | 298 v8::Isolate* secondIsolate = secondWorker->isolate(); |
| 299 ASSERT(secondIsolate); | 299 ASSERT(secondIsolate); |
| 300 EXPECT_EQ(firstIsolate, secondIsolate); | 300 EXPECT_EQ(firstIsolate, secondIsolate); |
| 301 | 301 |
| 302 // Verify that the isolate can run some scripts correctly in the second work
er. | 302 // Verify that the isolate can run some scripts correctly in the second work
er. |
| 303 checkWorkerCanExecuteScript(secondWorker.get()); | 303 checkWorkerCanExecuteScript(secondWorker.get()); |
| 304 secondWorker->terminateAndWait(); | 304 secondWorker->terminateAndWait(); |
| 305 } | 305 } |
| 306 | 306 |
| 307 } // namespace blink | 307 } // namespace blink |
| OLD | NEW |