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

Unified Diff: Source/modules/webaudio/AudioScheduledSourceNode.h

Issue 23596014: Keep AudioScheduledSourceNode alive until onended is called. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove ActiveDOMObject Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/modules/webaudio/AudioScheduledSourceNode.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webaudio/AudioScheduledSourceNode.h
diff --git a/Source/modules/webaudio/AudioScheduledSourceNode.h b/Source/modules/webaudio/AudioScheduledSourceNode.h
index 552fa0e75180ea09a107136d7e38de2fff382a3f..9f1788cb82dea149b5aa1fc86d52e9501d534421 100644
--- a/Source/modules/webaudio/AudioScheduledSourceNode.h
+++ b/Source/modules/webaudio/AudioScheduledSourceNode.h
@@ -54,6 +54,17 @@ public:
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 @@ protected:
virtual void finish();
static void notifyEndedDispatch(void*);
- void notifyEnded();
PlaybackState m_playbackState;
« no previous file with comments | « no previous file | Source/modules/webaudio/AudioScheduledSourceNode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698