Index: third_party/WebKit/Source/modules/webaudio/AudioScheduledSourceNode.h |
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioScheduledSourceNode.h b/third_party/WebKit/Source/modules/webaudio/AudioScheduledSourceNode.h |
index ed6a5300de45d6b370c3d958f7d13e75e6beef13..2b7d1d7f6aa515d2fd3798aae931ed52366f0914 100644 |
--- a/third_party/WebKit/Source/modules/webaudio/AudioScheduledSourceNode.h |
+++ b/third_party/WebKit/Source/modules/webaudio/AudioScheduledSourceNode.h |
@@ -122,17 +122,32 @@ private: |
class AudioScheduledSourceNode : public AudioSourceNode { |
public: |
- void start(ExceptionState&); |
- void start(double when, ExceptionState&); |
- void stop(ExceptionState&); |
- void stop(double when, ExceptionState&); |
+ void startNode(ExceptionState&); |
+ void startNode(double when, ExceptionState&); |
+ void stopNode(ExceptionState&); |
+ void stopNode(double when, ExceptionState&); |
EventListener* onended(); |
void setOnended(PassRefPtrWillBeRawPtr<EventListener>); |
+ // ScriptWrappable |
+ bool hasPendingActivity() const final; |
+ |
+ // It is possible to play a source node for a very long time or to schedule |
+ // too far in the future; thus infinitely playing/scheduled sources leak |
+ // when the execution context is tearing down because |hasPendingActivity| |
+ // returns true. |
+ // |
+ // So we call |markForGC| to mark the node as 'available for GC' regardless |
+ // of its playback state. |
+ void markForGC(); |
+ |
protected: |
explicit AudioScheduledSourceNode(AbstractAudioContext&); |
AudioScheduledSourceHandler& audioScheduledSourceHandler() const; |
+ |
+private: |
+ bool m_isMarkedForGC; |
}; |
} // namespace blink |