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

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

Issue 385953003: Revert of WebAudio: Remove AudioNode::RefType. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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
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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 // When the context goes away, there might still be some sources which haven 't finished playing. 260 // When the context goes away, there might still be some sources which haven 't finished playing.
261 // Make sure to dereference them here. 261 // Make sure to dereference them here.
262 void derefUnfinishedSourceNodes(); 262 void derefUnfinishedSourceNodes();
263 263
264 RefPtrWillBeMember<AudioDestinationNode> m_destinationNode; 264 RefPtrWillBeMember<AudioDestinationNode> m_destinationNode;
265 RefPtrWillBeMember<AudioListener> m_listener; 265 RefPtrWillBeMember<AudioListener> m_listener;
266 266
267 // Only accessed in the audio thread. 267 // Only accessed in the audio thread.
268 Vector<AudioNode*> m_finishedNodes; 268 Vector<AudioNode*> m_finishedNodes;
269 269
270 // List of source nodes. This is either accessed when the graph lock is 270 // We don't use RefPtr<AudioNode> here because AudioNode has a more complex ref() / deref() implementation
271 // held, or on the main thread when the audio thread has finished. 271 // with an optional argument for refType. We need to use the special refTyp e: RefTypeConnection
272 // This RefPtr is connection reference. We must call AudioNode:: 272 // Either accessed when the graph lock is held, or on the main thread when t he audio thread has finished.
273 // makeConnection() after ref(), and call AudioNode::breakConnection() 273 Vector<AudioNode*> m_referencedNodes;
274 // before deref().
275 Vector<RefPtr<AudioNode> > m_referencedNodes;
276 274
277 // Accumulate nodes which need to be deleted here. 275 // Accumulate nodes which need to be deleted here.
278 // This is copied to m_nodesToDelete at the end of a render cycle in handleP ostRenderTasks(), where we're assured of a stable graph 276 // This is copied to m_nodesToDelete at the end of a render cycle in handleP ostRenderTasks(), where we're assured of a stable graph
279 // state which will have no references to any of the nodes in m_nodesToDelet e once the context lock is released 277 // state which will have no references to any of the nodes in m_nodesToDelet e once the context lock is released
280 // (when handlePostRenderTasks() has completed). 278 // (when handlePostRenderTasks() has completed).
281 Vector<AudioNode*> m_nodesMarkedForDeletion; 279 Vector<AudioNode*> m_nodesMarkedForDeletion;
282 280
283 // They will be scheduled for deletion (on the main thread) at the end of a render cycle (in realtime thread). 281 // They will be scheduled for deletion (on the main thread) at the end of a render cycle (in realtime thread).
284 Vector<AudioNode*> m_nodesToDelete; 282 Vector<AudioNode*> m_nodesToDelete;
285 bool m_isDeletionScheduled; 283 bool m_isDeletionScheduled;
(...skipping 29 matching lines...) Expand all
315 AsyncAudioDecoder m_audioDecoder; 313 AsyncAudioDecoder m_audioDecoder;
316 314
317 // This is considering 32 is large enough for multiple channels audio. 315 // This is considering 32 is large enough for multiple channels audio.
318 // It is somewhat arbitrary and could be increased if necessary. 316 // It is somewhat arbitrary and could be increased if necessary.
319 enum { MaxNumberOfChannels = 32 }; 317 enum { MaxNumberOfChannels = 32 };
320 }; 318 };
321 319
322 } // WebCore 320 } // WebCore
323 321
324 #endif // AudioContext_h 322 #endif // AudioContext_h
OLDNEW
« no previous file with comments | « Source/modules/webaudio/AudioBufferSourceNode.cpp ('k') | Source/modules/webaudio/AudioContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698