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

Side by Side Diff: third_party/WebKit/Source/modules/webaudio/DeferredTaskHandler.cpp

Issue 2614663008: Migrate WTF::Vector::append() to ::push_back() [part 13 of N] (Closed)
Patch Set: Created 3 years, 11 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 /* 1 /*
2 * Copyright (C) 2010, Google Inc. All rights reserved. 2 * Copyright (C) 2010, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 } 66 }
67 67
68 #if ENABLE(ASSERT) 68 #if ENABLE(ASSERT)
69 bool DeferredTaskHandler::isGraphOwner() { 69 bool DeferredTaskHandler::isGraphOwner() {
70 return m_contextGraphMutex.locked(); 70 return m_contextGraphMutex.locked();
71 } 71 }
72 #endif 72 #endif
73 73
74 void DeferredTaskHandler::addDeferredBreakConnection(AudioHandler& node) { 74 void DeferredTaskHandler::addDeferredBreakConnection(AudioHandler& node) {
75 DCHECK(isAudioThread()); 75 DCHECK(isAudioThread());
76 m_deferredBreakConnectionList.append(&node); 76 m_deferredBreakConnectionList.push_back(&node);
77 } 77 }
78 78
79 void DeferredTaskHandler::breakConnections() { 79 void DeferredTaskHandler::breakConnections() {
80 DCHECK(isAudioThread()); 80 DCHECK(isAudioThread());
81 ASSERT(isGraphOwner()); 81 ASSERT(isGraphOwner());
82 82
83 for (unsigned i = 0; i < m_deferredBreakConnectionList.size(); ++i) 83 for (unsigned i = 0; i < m_deferredBreakConnectionList.size(); ++i)
84 m_deferredBreakConnectionList[i]->breakConnectionWithLock(); 84 m_deferredBreakConnectionList[i]->breakConnectionWithLock();
85 m_deferredBreakConnectionList.clear(); 85 m_deferredBreakConnectionList.clear();
86 } 86 }
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 DeferredTaskHandler::OfflineGraphAutoLocker::OfflineGraphAutoLocker( 245 DeferredTaskHandler::OfflineGraphAutoLocker::OfflineGraphAutoLocker(
246 OfflineAudioContext* context) 246 OfflineAudioContext* context)
247 : m_handler(context->deferredTaskHandler()) { 247 : m_handler(context->deferredTaskHandler()) {
248 m_handler.offlineLock(); 248 m_handler.offlineLock();
249 } 249 }
250 250
251 void DeferredTaskHandler::addRenderingOrphanHandler( 251 void DeferredTaskHandler::addRenderingOrphanHandler(
252 PassRefPtr<AudioHandler> handler) { 252 PassRefPtr<AudioHandler> handler) {
253 DCHECK(handler); 253 DCHECK(handler);
254 DCHECK(!m_renderingOrphanHandlers.contains(handler)); 254 DCHECK(!m_renderingOrphanHandlers.contains(handler));
255 m_renderingOrphanHandlers.append(handler); 255 m_renderingOrphanHandlers.push_back(handler);
256 } 256 }
257 257
258 void DeferredTaskHandler::requestToDeleteHandlersOnMainThread() { 258 void DeferredTaskHandler::requestToDeleteHandlersOnMainThread() {
259 ASSERT(isGraphOwner()); 259 ASSERT(isGraphOwner());
260 DCHECK(isAudioThread()); 260 DCHECK(isAudioThread());
261 if (m_renderingOrphanHandlers.isEmpty()) 261 if (m_renderingOrphanHandlers.isEmpty())
262 return; 262 return;
263 m_deletableOrphanHandlers.appendVector(m_renderingOrphanHandlers); 263 m_deletableOrphanHandlers.appendVector(m_renderingOrphanHandlers);
264 m_renderingOrphanHandlers.clear(); 264 m_renderingOrphanHandlers.clear();
265 Platform::current()->mainThread()->getWebTaskRunner()->postTask( 265 Platform::current()->mainThread()->getWebTaskRunner()->postTask(
(...skipping 15 matching lines...) Expand all
281 m_deletableOrphanHandlers.clear(); 281 m_deletableOrphanHandlers.clear();
282 } 282 }
283 283
284 void DeferredTaskHandler::setAudioThreadToCurrentThread() { 284 void DeferredTaskHandler::setAudioThreadToCurrentThread() {
285 DCHECK(!isMainThread()); 285 DCHECK(!isMainThread());
286 ThreadIdentifier thread = currentThread(); 286 ThreadIdentifier thread = currentThread();
287 releaseStore(&m_audioThread, thread); 287 releaseStore(&m_audioThread, thread);
288 } 288 }
289 289
290 } // namespace blink 290 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698