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

Side by Side Diff: third_party/WebKit/Source/modules/webaudio/AudioWorkletThread.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/webaudio/AudioWorkletThread.h" 5 #include "modules/webaudio/AudioWorkletThread.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/WorkerThreadStartupData.h" 9 #include "core/workers/WorkerThreadStartupData.h"
10 #include "modules/webaudio/AudioWorkletGlobalScope.h" 10 #include "modules/webaudio/AudioWorkletGlobalScope.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 } 53 }
54 54
55 void AudioWorkletThread::collectAllGarbage() { 55 void AudioWorkletThread::collectAllGarbage() {
56 DCHECK(isMainThread()); 56 DCHECK(isMainThread());
57 WaitableEvent doneEvent; 57 WaitableEvent doneEvent;
58 WorkletThreadHolder<AudioWorkletThread>* workletThreadHolder = 58 WorkletThreadHolder<AudioWorkletThread>* workletThreadHolder =
59 WorkletThreadHolder<AudioWorkletThread>::getInstance(); 59 WorkletThreadHolder<AudioWorkletThread>::getInstance();
60 if (!workletThreadHolder) 60 if (!workletThreadHolder)
61 return; 61 return;
62 workletThreadHolder->thread()->backingThread().postTask( 62 workletThreadHolder->thread()->backingThread().postTask(
63 BLINK_FROM_HERE, crossThreadBind(&collectAllGarbageOnAudioWorkletThread, 63 BLINK_FROM_HERE,
64 crossThreadUnretained(&doneEvent))); 64 crossThreadBind(&collectAllGarbageOnAudioWorkletThread,
65 crossThreadUnretained(&doneEvent)));
65 doneEvent.wait(); 66 doneEvent.wait();
66 } 67 }
67 68
68 void AudioWorkletThread::ensureSharedBackingThread() { 69 void AudioWorkletThread::ensureSharedBackingThread() {
69 DCHECK(isMainThread()); 70 DCHECK(isMainThread());
70 WorkletThreadHolder<AudioWorkletThread>::ensureInstance("AudioWorkletThread"); 71 WorkletThreadHolder<AudioWorkletThread>::ensureInstance("AudioWorkletThread");
71 } 72 }
72 73
73 void AudioWorkletThread::clearSharedBackingThread() { 74 void AudioWorkletThread::clearSharedBackingThread() {
74 DCHECK(isMainThread()); 75 DCHECK(isMainThread());
(...skipping 15 matching lines...) Expand all
90 securityOrigin->transferPrivilegesFrom( 91 securityOrigin->transferPrivilegesFrom(
91 std::move(startupData->m_starterOriginPrivilegeData)); 92 std::move(startupData->m_starterOriginPrivilegeData));
92 } 93 }
93 94
94 return AudioWorkletGlobalScope::create( 95 return AudioWorkletGlobalScope::create(
95 startupData->m_scriptURL, startupData->m_userAgent, 96 startupData->m_scriptURL, startupData->m_userAgent,
96 securityOrigin.release(), this->isolate(), this); 97 securityOrigin.release(), this->isolate(), this);
97 } 98 }
98 99
99 } // namespace blink 100 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698