Index: Source/modules/webaudio/AudioScheduledSourceNode.h |
=================================================================== |
--- Source/modules/webaudio/AudioScheduledSourceNode.h (revision 157760) |
+++ Source/modules/webaudio/AudioScheduledSourceNode.h (working copy) |
@@ -54,6 +54,17 @@ |
FINISHED_STATE = 3 |
}; |
+ // This helper class handles the lifetime of an AudioScheduledSourceNode with an onended event |
+ // listener. This keeps the node alive until the event listener is processed. |
+ class NotifyEndedTask { |
+ public: |
+ NotifyEndedTask(PassRefPtr<AudioScheduledSourceNode> scheduledNode); |
+ void notifyEnded(); |
+ |
+ private: |
+ RefPtr<AudioScheduledSourceNode> m_scheduledNode; |
+ }; |
+ |
AudioScheduledSourceNode(AudioContext*, float sampleRate); |
// Scheduling. |
@@ -87,7 +98,6 @@ |
virtual void finish(); |
static void notifyEndedDispatch(void*); |
- void notifyEnded(); |
PlaybackState m_playbackState; |