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

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

Issue 2701993002: DO NOT COMMIT: Results of running new (proposed) clang-format on Blink (Closed)
Patch Set: Created 3 years, 10 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 <memory> 7 #include <memory>
8 #include "core/workers/WorkerBackingThread.h" 8 #include "core/workers/WorkerBackingThread.h"
9 #include "core/workers/WorkletThreadHolder.h" 9 #include "core/workers/WorkletThreadHolder.h"
10 #include "platform/CrossThreadFunctional.h" 10 #include "platform/CrossThreadFunctional.h"
(...skipping 27 matching lines...) Expand all
38 } 38 }
39 39
40 void AbstractAnimationWorkletThread::collectAllGarbage() { 40 void AbstractAnimationWorkletThread::collectAllGarbage() {
41 DCHECK(isMainThread()); 41 DCHECK(isMainThread());
42 WaitableEvent doneEvent; 42 WaitableEvent doneEvent;
43 WorkletThreadHolder<AbstractAnimationWorkletThread>* workletThreadHolder = 43 WorkletThreadHolder<AbstractAnimationWorkletThread>* workletThreadHolder =
44 WorkletThreadHolder<AbstractAnimationWorkletThread>::getInstance(); 44 WorkletThreadHolder<AbstractAnimationWorkletThread>::getInstance();
45 if (!workletThreadHolder) 45 if (!workletThreadHolder)
46 return; 46 return;
47 workletThreadHolder->thread()->backingThread().postTask( 47 workletThreadHolder->thread()->backingThread().postTask(
48 BLINK_FROM_HERE, crossThreadBind(&collectAllGarbageOnThread, 48 BLINK_FROM_HERE,
49 crossThreadUnretained(&doneEvent))); 49 crossThreadBind(&collectAllGarbageOnThread,
50 crossThreadUnretained(&doneEvent)));
50 doneEvent.wait(); 51 doneEvent.wait();
51 } 52 }
52 53
53 void AbstractAnimationWorkletThread::ensureSharedBackingThread() { 54 void AbstractAnimationWorkletThread::ensureSharedBackingThread() {
54 DCHECK(isMainThread()); 55 DCHECK(isMainThread());
55 WorkletThreadHolder<AbstractAnimationWorkletThread>::ensureInstance( 56 WorkletThreadHolder<AbstractAnimationWorkletThread>::ensureInstance(
56 Platform::current()->compositorThread()); 57 Platform::current()->compositorThread());
57 } 58 }
58 59
59 void AbstractAnimationWorkletThread::clearSharedBackingThread() { 60 void AbstractAnimationWorkletThread::clearSharedBackingThread() {
60 DCHECK(isMainThread()); 61 DCHECK(isMainThread());
61 WorkletThreadHolder<AbstractAnimationWorkletThread>::clearInstance(); 62 WorkletThreadHolder<AbstractAnimationWorkletThread>::clearInstance();
62 } 63 }
63 64
64 void AbstractAnimationWorkletThread::createSharedBackingThreadForTest() { 65 void AbstractAnimationWorkletThread::createSharedBackingThreadForTest() {
65 WorkletThreadHolder<AbstractAnimationWorkletThread>::createForTest( 66 WorkletThreadHolder<AbstractAnimationWorkletThread>::createForTest(
66 Platform::current()->compositorThread()); 67 Platform::current()->compositorThread());
67 } 68 }
68 69
69 } // namespace blink 70 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698