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

Side by Side Diff: Source/modules/webaudio/AudioContext.h

Issue 386403002: WebAudio: Split AudioNode::finishDeref into two parts. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: apply review comments Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/modules/webaudio/AudioContext.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 ~AutoLocker() 196 ~AutoLocker()
197 { 197 {
198 if (m_mustReleaseLock) 198 if (m_mustReleaseLock)
199 m_context->unlock(); 199 m_context->unlock();
200 } 200 }
201 private: 201 private:
202 AudioContext* m_context; 202 AudioContext* m_context;
203 bool m_mustReleaseLock; 203 bool m_mustReleaseLock;
204 }; 204 };
205 205
206 // In AudioNode::deref() a tryLock() is used for calling finishDeref(), but if it fails keep track here. 206 // In AudioNode::breakConnection() and deref(), a tryLock() is used for
207 // calling actual processing, but if it fails keep track here.
208 void addDeferredBreakConnection(AudioNode&);
207 void addDeferredFinishDeref(AudioNode*); 209 void addDeferredFinishDeref(AudioNode*);
208 210
209 // In the audio thread at the start of each render cycle, we'll call handleD eferredFinishDerefs(). 211 // In the audio thread at the start of each render cycle, we'll call this.
210 void handleDeferredFinishDerefs(); 212 void handleDeferredAudioNodeTasks();
211 213
212 // Only accessed when the graph lock is held. 214 // Only accessed when the graph lock is held.
213 void markSummingJunctionDirty(AudioSummingJunction*); 215 void markSummingJunctionDirty(AudioSummingJunction*);
214 void markAudioNodeOutputDirty(AudioNodeOutput*); 216 void markAudioNodeOutputDirty(AudioNodeOutput*);
215 217
216 // Must be called on main thread. 218 // Must be called on main thread.
217 void removeMarkedSummingJunction(AudioSummingJunction*); 219 void removeMarkedSummingJunction(AudioSummingJunction*);
218 220
219 // EventTarget 221 // EventTarget
220 virtual const AtomicString& interfaceName() const OVERRIDE FINAL; 222 virtual const AtomicString& interfaceName() const OVERRIDE FINAL;
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 void updateAutomaticPullNodes(); 301 void updateAutomaticPullNodes();
300 302
301 unsigned m_connectionCount; 303 unsigned m_connectionCount;
302 304
303 // Graph locking. 305 // Graph locking.
304 Mutex m_contextGraphMutex; 306 Mutex m_contextGraphMutex;
305 volatile ThreadIdentifier m_audioThread; 307 volatile ThreadIdentifier m_audioThread;
306 volatile ThreadIdentifier m_graphOwnerThread; // if the lock is held then th is is the thread which owns it, otherwise == UndefinedThreadIdentifier 308 volatile ThreadIdentifier m_graphOwnerThread; // if the lock is held then th is is the thread which owns it, otherwise == UndefinedThreadIdentifier
307 309
308 // Only accessed in the audio thread. 310 // Only accessed in the audio thread.
311 Vector<AudioNode*> m_deferredBreakConnectionList;
309 Vector<AudioNode*> m_deferredFinishDerefList; 312 Vector<AudioNode*> m_deferredFinishDerefList;
310 313
311 RefPtrWillBeMember<AudioBuffer> m_renderTarget; 314 RefPtrWillBeMember<AudioBuffer> m_renderTarget;
312 315
313 bool m_isOfflineContext; 316 bool m_isOfflineContext;
314 317
315 AsyncAudioDecoder m_audioDecoder; 318 AsyncAudioDecoder m_audioDecoder;
316 319
317 // This is considering 32 is large enough for multiple channels audio. 320 // This is considering 32 is large enough for multiple channels audio.
318 // It is somewhat arbitrary and could be increased if necessary. 321 // It is somewhat arbitrary and could be increased if necessary.
319 enum { MaxNumberOfChannels = 32 }; 322 enum { MaxNumberOfChannels = 32 };
320 }; 323 };
321 324
322 } // WebCore 325 } // WebCore
323 326
324 #endif // AudioContext_h 327 #endif // AudioContext_h
OLDNEW
« no previous file with comments | « no previous file | Source/modules/webaudio/AudioContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698