| 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/SourceLocation.h" | 8 #include "bindings/core/v8/SourceLocation.h" |
| 9 #include "bindings/core/v8/V8GCController.h" | 9 #include "bindings/core/v8/V8GCController.h" |
| 10 #include "bindings/core/v8/WorkerOrWorkletScriptController.h" | 10 #include "bindings/core/v8/WorkerOrWorkletScriptController.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 void didCloseWorkerGlobalScope() override {} | 55 void didCloseWorkerGlobalScope() override {} |
| 56 void willDestroyWorkerGlobalScope() override {} | 56 void willDestroyWorkerGlobalScope() override {} |
| 57 void didTerminateWorkerThread() override {} | 57 void didTerminateWorkerThread() override {} |
| 58 | 58 |
| 59 private: | 59 private: |
| 60 explicit TestCompositorWorkerObjectProxy( | 60 explicit TestCompositorWorkerObjectProxy( |
| 61 ParentFrameTaskRunners* parentFrameTaskRunners) | 61 ParentFrameTaskRunners* parentFrameTaskRunners) |
| 62 : InProcessWorkerObjectProxy(nullptr, parentFrameTaskRunners) {} | 62 : InProcessWorkerObjectProxy(nullptr, parentFrameTaskRunners) {} |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 class TestCompositorWorkerProxyClient : public CompositorWorkerProxyClient { | 65 class TestCompositorWorkerProxyClient |
| 66 : public GarbageCollected<TestCompositorWorkerProxyClient>, |
| 67 public CompositorWorkerProxyClient { |
| 68 USING_GARBAGE_COLLECTED_MIXIN(TestCompositorWorkerProxyClient); |
| 69 |
| 66 public: | 70 public: |
| 67 TestCompositorWorkerProxyClient() {} | 71 TestCompositorWorkerProxyClient() {} |
| 68 | 72 |
| 69 void dispose() override {} | 73 void dispose() override {} |
| 70 void setGlobalScope(WorkerGlobalScope*) override {} | 74 void setGlobalScope(WorkerGlobalScope*) override {} |
| 71 void requestAnimationFrame() override {} | 75 void requestAnimationFrame() override {} |
| 72 void registerCompositorProxy(CompositorProxy*) override {} | 76 CompositorProxyClient* compositorProxyClient() override { return nullptr; }; |
| 73 void unregisterCompositorProxy(CompositorProxy*) override {} | |
| 74 }; | 77 }; |
| 75 | 78 |
| 76 class CompositorWorkerTestPlatform : public TestingPlatformSupport { | 79 class CompositorWorkerTestPlatform : public TestingPlatformSupport { |
| 77 public: | 80 public: |
| 78 CompositorWorkerTestPlatform() | 81 CompositorWorkerTestPlatform() |
| 79 : m_thread(WTF::wrapUnique(m_oldPlatform->createThread("Compositor"))) {} | 82 : m_thread(WTF::wrapUnique(m_oldPlatform->createThread("Compositor"))) {} |
| 80 | 83 |
| 81 WebThread* compositorThread() const override { return m_thread.get(); } | 84 WebThread* compositorThread() const override { return m_thread.get(); } |
| 82 | 85 |
| 83 WebCompositorSupport* compositorSupport() override { | 86 WebCompositorSupport* compositorSupport() override { |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 ASSERT_TRUE(secondIsolate); | 242 ASSERT_TRUE(secondIsolate); |
| 240 EXPECT_EQ(firstIsolate, secondIsolate); | 243 EXPECT_EQ(firstIsolate, secondIsolate); |
| 241 | 244 |
| 242 // Verify that the isolate can run some scripts correctly in the second | 245 // Verify that the isolate can run some scripts correctly in the second |
| 243 // worker. | 246 // worker. |
| 244 checkWorkerCanExecuteScript(secondWorker.get()); | 247 checkWorkerCanExecuteScript(secondWorker.get()); |
| 245 secondWorker->terminateAndWait(); | 248 secondWorker->terminateAndWait(); |
| 246 } | 249 } |
| 247 | 250 |
| 248 } // namespace blink | 251 } // namespace blink |
| OLD | NEW |