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 #include "modules/compositorworker/AbstractAnimationWorkletThread.h" | 5 #include "modules/compositorworker/AbstractAnimationWorkletThread.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
| 8 #include "core/loader/ThreadableLoadingContext.h" |
8 #include "core/workers/WorkerBackingThread.h" | 9 #include "core/workers/WorkerBackingThread.h" |
9 #include "core/workers/WorkletThreadHolder.h" | 10 #include "core/workers/WorkletThreadHolder.h" |
10 #include "platform/CrossThreadFunctional.h" | 11 #include "platform/CrossThreadFunctional.h" |
11 #include "platform/WebThreadSupportingGC.h" | 12 #include "platform/WebThreadSupportingGC.h" |
12 #include "platform/wtf/Assertions.h" | 13 #include "platform/wtf/Assertions.h" |
13 #include "platform/wtf/PtrUtil.h" | 14 #include "platform/wtf/PtrUtil.h" |
14 #include "public/platform/Platform.h" | 15 #include "public/platform/Platform.h" |
15 | 16 |
16 namespace blink { | 17 namespace blink { |
17 | 18 |
18 template class WorkletThreadHolder<AbstractAnimationWorkletThread>; | 19 template class WorkletThreadHolder<AbstractAnimationWorkletThread>; |
19 | 20 |
20 AbstractAnimationWorkletThread::AbstractAnimationWorkletThread( | 21 AbstractAnimationWorkletThread::AbstractAnimationWorkletThread( |
21 PassRefPtr<WorkerLoaderProxy> worker_loader_proxy, | 22 ThreadableLoadingContext* loading_context, |
22 WorkerReportingProxy& worker_reporting_proxy) | 23 WorkerReportingProxy& worker_reporting_proxy) |
23 : WorkerThread(std::move(worker_loader_proxy), worker_reporting_proxy) {} | 24 : WorkerThread(loading_context, worker_reporting_proxy) {} |
24 | 25 |
25 AbstractAnimationWorkletThread::~AbstractAnimationWorkletThread() {} | 26 AbstractAnimationWorkletThread::~AbstractAnimationWorkletThread() {} |
26 | 27 |
27 WorkerBackingThread& AbstractAnimationWorkletThread::GetWorkerBackingThread() { | 28 WorkerBackingThread& AbstractAnimationWorkletThread::GetWorkerBackingThread() { |
28 return *WorkletThreadHolder<AbstractAnimationWorkletThread>::GetInstance() | 29 return *WorkletThreadHolder<AbstractAnimationWorkletThread>::GetInstance() |
29 ->GetThread(); | 30 ->GetThread(); |
30 } | 31 } |
31 | 32 |
32 void CollectAllGarbageOnThread(WaitableEvent* done_event) { | 33 void CollectAllGarbageOnThread(WaitableEvent* done_event) { |
33 blink::ThreadState::Current()->CollectAllGarbage(); | 34 blink::ThreadState::Current()->CollectAllGarbage(); |
(...skipping 23 matching lines...) Expand all Loading... |
57 DCHECK(IsMainThread()); | 58 DCHECK(IsMainThread()); |
58 WorkletThreadHolder<AbstractAnimationWorkletThread>::ClearInstance(); | 59 WorkletThreadHolder<AbstractAnimationWorkletThread>::ClearInstance(); |
59 } | 60 } |
60 | 61 |
61 void AbstractAnimationWorkletThread::CreateSharedBackingThreadForTest() { | 62 void AbstractAnimationWorkletThread::CreateSharedBackingThreadForTest() { |
62 WorkletThreadHolder<AbstractAnimationWorkletThread>::CreateForTest( | 63 WorkletThreadHolder<AbstractAnimationWorkletThread>::CreateForTest( |
63 Platform::Current()->CompositorThread()); | 64 Platform::Current()->CompositorThread()); |
64 } | 65 } |
65 | 66 |
66 } // namespace blink | 67 } // namespace blink |
OLD | NEW |