| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef AbstractAnimationWorkletThread_h | 5 #ifndef AbstractAnimationWorkletThread_h |
| 6 #define AbstractAnimationWorkletThread_h | 6 #define AbstractAnimationWorkletThread_h |
| 7 | 7 |
| 8 #include "core/workers/WorkerLoaderProxy.h" | |
| 9 #include "core/workers/WorkerThread.h" | 8 #include "core/workers/WorkerThread.h" |
| 10 #include "modules/ModulesExport.h" | 9 #include "modules/ModulesExport.h" |
| 11 #include <memory> | 10 #include <memory> |
| 12 | 11 |
| 13 namespace blink { | 12 namespace blink { |
| 14 | 13 |
| 14 class ThreadableLoadingContext; |
| 15 class WorkerReportingProxy; | 15 class WorkerReportingProxy; |
| 16 | 16 |
| 17 // TODO(ikilpatrick): Remove this class up to AnimationWorkletThread once we no | 17 // TODO(ikilpatrick): Remove this class up to AnimationWorkletThread once we no |
| 18 // longer have CompositorWorker. | 18 // longer have CompositorWorker. |
| 19 class MODULES_EXPORT AbstractAnimationWorkletThread : public WorkerThread { | 19 class MODULES_EXPORT AbstractAnimationWorkletThread : public WorkerThread { |
| 20 public: | 20 public: |
| 21 ~AbstractAnimationWorkletThread() override; | 21 ~AbstractAnimationWorkletThread() override; |
| 22 | 22 |
| 23 WorkerBackingThread& GetWorkerBackingThread() override; | 23 WorkerBackingThread& GetWorkerBackingThread() override; |
| 24 | 24 |
| 25 // The backing thread is cleared by clearSharedBackingThread(). | 25 // The backing thread is cleared by clearSharedBackingThread(). |
| 26 void ClearWorkerBackingThread() override {} | 26 void ClearWorkerBackingThread() override {} |
| 27 | 27 |
| 28 // This may block the main thread. | 28 // This may block the main thread. |
| 29 static void CollectAllGarbage(); | 29 static void CollectAllGarbage(); |
| 30 | 30 |
| 31 static void EnsureSharedBackingThread(); | 31 static void EnsureSharedBackingThread(); |
| 32 static void ClearSharedBackingThread(); | 32 static void ClearSharedBackingThread(); |
| 33 | 33 |
| 34 static void CreateSharedBackingThreadForTest(); | 34 static void CreateSharedBackingThreadForTest(); |
| 35 | 35 |
| 36 protected: | 36 protected: |
| 37 AbstractAnimationWorkletThread(PassRefPtr<WorkerLoaderProxy>, | 37 AbstractAnimationWorkletThread(ThreadableLoadingContext*, |
| 38 WorkerReportingProxy&); | 38 WorkerReportingProxy&); |
| 39 | 39 |
| 40 bool IsOwningBackingThread() const override { return false; } | 40 bool IsOwningBackingThread() const override { return false; } |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 } // namespace blink | 43 } // namespace blink |
| 44 | 44 |
| 45 #endif // AbstractAnimationWorkletThread_h | 45 #endif // AbstractAnimationWorkletThread_h |
| OLD | NEW |