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

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

Issue 2276973002: Revert CL 2242573002 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 3 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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 154
155 ~OfflineGraphAutoLocker() { m_handler.unlock(); } 155 ~OfflineGraphAutoLocker() { m_handler.unlock(); }
156 156
157 private: 157 private:
158 DeferredTaskHandler& m_handler; 158 DeferredTaskHandler& m_handler;
159 }; 159 };
160 160
161 private: 161 private:
162 DeferredTaskHandler(); 162 DeferredTaskHandler();
163 void updateAutomaticPullNodes(); 163 void updateAutomaticPullNodes();
164 void updateChangedChannelCountMode();
165 void updateChangedChannelInterpretation();
164 void handleDirtyAudioSummingJunctions(); 166 void handleDirtyAudioSummingJunctions();
165 void handleDirtyAudioNodeOutputs(); 167 void handleDirtyAudioNodeOutputs();
166 void deleteHandlersOnMainThread(); 168 void deleteHandlersOnMainThread();
167 169
168 // For the sake of thread safety, we maintain a seperate Vector of automatic 170 // For the sake of thread safety, we maintain a seperate Vector of automatic
169 // pull nodes for rendering in m_renderingAutomaticPullNodes. It will be 171 // pull nodes for rendering in m_renderingAutomaticPullNodes. It will be
170 // copied from m_automaticPullNodes by updateAutomaticPullNodes() at the 172 // copied from m_automaticPullNodes by updateAutomaticPullNodes() at the
171 // very start or end of the rendering quantum. 173 // very start or end of the rendering quantum.
172 HashSet<AudioHandler*> m_automaticPullNodes; 174 HashSet<AudioHandler*> m_automaticPullNodes;
173 Vector<AudioHandler*> m_renderingAutomaticPullNodes; 175 Vector<AudioHandler*> m_renderingAutomaticPullNodes;
174 // m_automaticPullNodesNeedUpdating keeps track if m_automaticPullNodes is m odified. 176 // m_automaticPullNodesNeedUpdating keeps track if m_automaticPullNodes is m odified.
175 bool m_automaticPullNodesNeedUpdating; 177 bool m_automaticPullNodesNeedUpdating;
176 178
179 // Collection of nodes where the channel count mode has changed. We want the
180 // channel count mode to change in the pre- or post-rendering phase so as
181 // not to disturb the running audio thread.
182 HashSet<AudioHandler*> m_deferredCountModeChange;
183
184 HashSet<AudioHandler*> m_deferredChannelInterpretationChange;
185
177 // These two HashSet must be accessed only when the graph lock is held. 186 // These two HashSet must be accessed only when the graph lock is held.
178 // These raw pointers are safe because their destructors unregister them. 187 // These raw pointers are safe because their destructors unregister them.
179 HashSet<AudioSummingJunction*> m_dirtySummingJunctions; 188 HashSet<AudioSummingJunction*> m_dirtySummingJunctions;
180 HashSet<AudioNodeOutput*> m_dirtyAudioNodeOutputs; 189 HashSet<AudioNodeOutput*> m_dirtyAudioNodeOutputs;
181 190
182 // Only accessed in the audio thread. 191 // Only accessed in the audio thread.
183 Vector<AudioHandler*> m_deferredBreakConnectionList; 192 Vector<AudioHandler*> m_deferredBreakConnectionList;
184 193
185 Vector<RefPtr<AudioHandler>> m_renderingOrphanHandlers; 194 Vector<RefPtr<AudioHandler>> m_renderingOrphanHandlers;
186 Vector<RefPtr<AudioHandler>> m_deletableOrphanHandlers; 195 Vector<RefPtr<AudioHandler>> m_deletableOrphanHandlers;
187 196
188 // Graph locking. 197 // Graph locking.
189 RecursiveMutex m_contextGraphMutex; 198 RecursiveMutex m_contextGraphMutex;
190 volatile ThreadIdentifier m_audioThread; 199 volatile ThreadIdentifier m_audioThread;
191 }; 200 };
192 201
193 } // namespace blink 202 } // namespace blink
194 203
195 #endif // DeferredTaskHandler_h 204 #endif // DeferredTaskHandler_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698