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