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

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

Issue 2657443005: Migrate WTF::HashSet::add() to ::insert() [part 1 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
87 87
88 void DeferredTaskHandler::markSummingJunctionDirty( 88 void DeferredTaskHandler::markSummingJunctionDirty(
89 AudioSummingJunction* summingJunction) { 89 AudioSummingJunction* summingJunction) {
90 ASSERT(isGraphOwner()); 90 ASSERT(isGraphOwner());
91 m_dirtySummingJunctions.add(summingJunction); 91 m_dirtySummingJunctions.insert(summingJunction);
92 } 92 }
93 93
94 void DeferredTaskHandler::removeMarkedSummingJunction( 94 void DeferredTaskHandler::removeMarkedSummingJunction(
95 AudioSummingJunction* summingJunction) { 95 AudioSummingJunction* summingJunction) {
96 DCHECK(isMainThread()); 96 DCHECK(isMainThread());
97 AutoLocker locker(*this); 97 AutoLocker locker(*this);
98 m_dirtySummingJunctions.remove(summingJunction); 98 m_dirtySummingJunctions.remove(summingJunction);
99 } 99 }
100 100
101 void DeferredTaskHandler::markAudioNodeOutputDirty(AudioNodeOutput* output) { 101 void DeferredTaskHandler::markAudioNodeOutputDirty(AudioNodeOutput* output) {
102 ASSERT(isGraphOwner()); 102 ASSERT(isGraphOwner());
103 DCHECK(isMainThread()); 103 DCHECK(isMainThread());
104 m_dirtyAudioNodeOutputs.add(output); 104 m_dirtyAudioNodeOutputs.insert(output);
105 } 105 }
106 106
107 void DeferredTaskHandler::removeMarkedAudioNodeOutput(AudioNodeOutput* output) { 107 void DeferredTaskHandler::removeMarkedAudioNodeOutput(AudioNodeOutput* output) {
108 ASSERT(isGraphOwner()); 108 ASSERT(isGraphOwner());
109 DCHECK(isMainThread()); 109 DCHECK(isMainThread());
110 m_dirtyAudioNodeOutputs.remove(output); 110 m_dirtyAudioNodeOutputs.remove(output);
111 } 111 }
112 112
113 void DeferredTaskHandler::handleDirtyAudioSummingJunctions() { 113 void DeferredTaskHandler::handleDirtyAudioSummingJunctions() {
114 ASSERT(isGraphOwner()); 114 ASSERT(isGraphOwner());
(...skipping 13 matching lines...) Expand all
128 // further down the chain to be marked as dirty. These will not 128 // further down the chain to be marked as dirty. These will not
129 // be processed in this render quantum. 129 // be processed in this render quantum.
130 for (AudioNodeOutput* output : dirtyOutputs) 130 for (AudioNodeOutput* output : dirtyOutputs)
131 output->updateRenderingState(); 131 output->updateRenderingState();
132 } 132 }
133 133
134 void DeferredTaskHandler::addAutomaticPullNode(AudioHandler* node) { 134 void DeferredTaskHandler::addAutomaticPullNode(AudioHandler* node) {
135 ASSERT(isGraphOwner()); 135 ASSERT(isGraphOwner());
136 136
137 if (!m_automaticPullNodes.contains(node)) { 137 if (!m_automaticPullNodes.contains(node)) {
138 m_automaticPullNodes.add(node); 138 m_automaticPullNodes.insert(node);
139 m_automaticPullNodesNeedUpdating = true; 139 m_automaticPullNodesNeedUpdating = true;
140 } 140 }
141 } 141 }
142 142
143 void DeferredTaskHandler::removeAutomaticPullNode(AudioHandler* node) { 143 void DeferredTaskHandler::removeAutomaticPullNode(AudioHandler* node) {
144 ASSERT(isGraphOwner()); 144 ASSERT(isGraphOwner());
145 145
146 if (m_automaticPullNodes.contains(node)) { 146 if (m_automaticPullNodes.contains(node)) {
147 m_automaticPullNodes.remove(node); 147 m_automaticPullNodes.remove(node);
148 m_automaticPullNodesNeedUpdating = true; 148 m_automaticPullNodesNeedUpdating = true;
(...skipping 12 matching lines...) Expand all
161 void DeferredTaskHandler::processAutomaticPullNodes(size_t framesToProcess) { 161 void DeferredTaskHandler::processAutomaticPullNodes(size_t framesToProcess) {
162 DCHECK(isAudioThread()); 162 DCHECK(isAudioThread());
163 163
164 for (unsigned i = 0; i < m_renderingAutomaticPullNodes.size(); ++i) 164 for (unsigned i = 0; i < m_renderingAutomaticPullNodes.size(); ++i)
165 m_renderingAutomaticPullNodes[i]->processIfNecessary(framesToProcess); 165 m_renderingAutomaticPullNodes[i]->processIfNecessary(framesToProcess);
166 } 166 }
167 167
168 void DeferredTaskHandler::addChangedChannelCountMode(AudioHandler* node) { 168 void DeferredTaskHandler::addChangedChannelCountMode(AudioHandler* node) {
169 ASSERT(isGraphOwner()); 169 ASSERT(isGraphOwner());
170 DCHECK(isMainThread()); 170 DCHECK(isMainThread());
171 m_deferredCountModeChange.add(node); 171 m_deferredCountModeChange.insert(node);
172 } 172 }
173 173
174 void DeferredTaskHandler::removeChangedChannelCountMode(AudioHandler* node) { 174 void DeferredTaskHandler::removeChangedChannelCountMode(AudioHandler* node) {
175 ASSERT(isGraphOwner()); 175 ASSERT(isGraphOwner());
176 176
177 m_deferredCountModeChange.remove(node); 177 m_deferredCountModeChange.remove(node);
178 } 178 }
179 179
180 void DeferredTaskHandler::addChangedChannelInterpretation(AudioHandler* node) { 180 void DeferredTaskHandler::addChangedChannelInterpretation(AudioHandler* node) {
181 ASSERT(isGraphOwner()); 181 ASSERT(isGraphOwner());
182 DCHECK(isMainThread()); 182 DCHECK(isMainThread());
183 m_deferredChannelInterpretationChange.add(node); 183 m_deferredChannelInterpretationChange.insert(node);
184 } 184 }
185 185
186 void DeferredTaskHandler::removeChangedChannelInterpretation( 186 void DeferredTaskHandler::removeChangedChannelInterpretation(
187 AudioHandler* node) { 187 AudioHandler* node) {
188 ASSERT(isGraphOwner()); 188 ASSERT(isGraphOwner());
189 189
190 m_deferredChannelInterpretationChange.remove(node); 190 m_deferredChannelInterpretationChange.remove(node);
191 } 191 }
192 192
193 void DeferredTaskHandler::updateChangedChannelCountMode() { 193 void DeferredTaskHandler::updateChangedChannelCountMode() {
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
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