Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Side by Side Diff: third_party/WebKit/Source/modules/compositorworker/AbstractAnimationWorkletThread.cpp

Issue 2718643002: Worker: Pass ParentFrameTaskRunners via WorkerThread::start() instead of the ctor (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "core/workers/WorkerBackingThread.h" 7 #include "core/workers/WorkerBackingThread.h"
8 #include "core/workers/WorkletThreadHolder.h" 8 #include "core/workers/WorkletThreadHolder.h"
9 #include "platform/CrossThreadFunctional.h" 9 #include "platform/CrossThreadFunctional.h"
10 #include "platform/WebThreadSupportingGC.h" 10 #include "platform/WebThreadSupportingGC.h"
11 #include "public/platform/Platform.h" 11 #include "public/platform/Platform.h"
12 #include "wtf/Assertions.h" 12 #include "wtf/Assertions.h"
13 #include "wtf/PtrUtil.h" 13 #include "wtf/PtrUtil.h"
14 #include <memory> 14 #include <memory>
15 15
16 namespace blink { 16 namespace blink {
17 17
18 template class WorkletThreadHolder<AbstractAnimationWorkletThread>; 18 template class WorkletThreadHolder<AbstractAnimationWorkletThread>;
19 19
20 AbstractAnimationWorkletThread::AbstractAnimationWorkletThread( 20 AbstractAnimationWorkletThread::AbstractAnimationWorkletThread(
21 PassRefPtr<WorkerLoaderProxy> workerLoaderProxy, 21 PassRefPtr<WorkerLoaderProxy> workerLoaderProxy,
22 WorkerReportingProxy& workerReportingProxy, 22 WorkerReportingProxy& workerReportingProxy)
23 ParentFrameTaskRunners* parentFrameTaskRunners) 23 : WorkerThread(std::move(workerLoaderProxy), workerReportingProxy) {}
24 : WorkerThread(std::move(workerLoaderProxy),
25 workerReportingProxy,
26 parentFrameTaskRunners) {}
27 24
28 AbstractAnimationWorkletThread::~AbstractAnimationWorkletThread() {} 25 AbstractAnimationWorkletThread::~AbstractAnimationWorkletThread() {}
29 26
30 WorkerBackingThread& AbstractAnimationWorkletThread::workerBackingThread() { 27 WorkerBackingThread& AbstractAnimationWorkletThread::workerBackingThread() {
31 return *WorkletThreadHolder<AbstractAnimationWorkletThread>::getInstance() 28 return *WorkletThreadHolder<AbstractAnimationWorkletThread>::getInstance()
32 ->thread(); 29 ->thread();
33 } 30 }
34 31
35 void collectAllGarbageOnThread(WaitableEvent* doneEvent) { 32 void collectAllGarbageOnThread(WaitableEvent* doneEvent) {
36 blink::ThreadState::current()->collectAllGarbage(); 33 blink::ThreadState::current()->collectAllGarbage();
(...skipping 23 matching lines...) Expand all
60 DCHECK(isMainThread()); 57 DCHECK(isMainThread());
61 WorkletThreadHolder<AbstractAnimationWorkletThread>::clearInstance(); 58 WorkletThreadHolder<AbstractAnimationWorkletThread>::clearInstance();
62 } 59 }
63 60
64 void AbstractAnimationWorkletThread::createSharedBackingThreadForTest() { 61 void AbstractAnimationWorkletThread::createSharedBackingThreadForTest() {
65 WorkletThreadHolder<AbstractAnimationWorkletThread>::createForTest( 62 WorkletThreadHolder<AbstractAnimationWorkletThread>::createForTest(
66 Platform::current()->compositorThread()); 63 Platform::current()->compositorThread());
67 } 64 }
68 65
69 } // namespace blink 66 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698