Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / modules / webaudio / AudioBufferSourceNode.h
index d8efe5b..cb24a38 100644 (file)
@@ -44,7 +44,7 @@ class AudioContext;
 
 class AudioBufferSourceNode FINAL : public AudioScheduledSourceNode {
 public:
-    static PassRefPtr<AudioBufferSourceNode> create(AudioContext*, float sampleRate);
+    static PassRefPtrWillBeRawPtr<AudioBufferSourceNode> create(AudioContext*, float sampleRate);
 
     virtual ~AudioBufferSourceNode();
 
@@ -65,8 +65,6 @@ public:
     void start(double when, double grainOffset, ExceptionState&);
     void start(double when, double grainOffset, double grainDuration, ExceptionState&);
 
-    void noteGrainOn(double when, double grainOffset, double grainDuration, ExceptionState&);
-
     // Note: the attribute was originally exposed as .looping, but to be more consistent in naming with <audio>
     // and with how it's described in the specification, the proper attribute name is .loop
     // The old attribute is kept for backwards compatibility.
@@ -79,7 +77,6 @@ public:
     void setLoopStart(double loopStart) { m_loopStart = loopStart; }
     void setLoopEnd(double loopEnd) { m_loopEnd = loopEnd; }
 
-    AudioParam* gain() { return m_gain.get(); }
     AudioParam* playbackRate() { return m_playbackRate.get(); }
 
     // If a panner node is set, then we can incorporate doppler shift into the playback pitch rate.
@@ -92,6 +89,8 @@ public:
     // AudioScheduledSourceNode
     virtual void finish() OVERRIDE;
 
+    virtual void trace(Visitor*) OVERRIDE;
+
 private:
     AudioBufferSourceNode(AudioContext*, float sampleRate);
 
@@ -102,15 +101,14 @@ private:
     inline bool renderSilenceAndFinishIfNotLooping(AudioBus*, unsigned index, size_t framesToProcess);
 
     // m_buffer holds the sample data which this node outputs.
-    RefPtr<AudioBuffer> m_buffer;
+    RefPtrWillBeMember<AudioBuffer> m_buffer;
 
     // Pointers for the buffer and destination.
     OwnPtr<const float*[]> m_sourceChannels;
     OwnPtr<float*[]> m_destinationChannels;
 
-    // Used for the "gain" and "playbackRate" attributes.
-    RefPtr<AudioParam> m_gain;
-    RefPtr<AudioParam> m_playbackRate;
+    // Used for the "playbackRate" attributes.
+    RefPtrWillBeMember<AudioParam> m_playbackRate;
 
     // If m_isLooping is false, then this node will be done playing and become inactive after it reaches the end of the sample data in the buffer.
     // If true, it will wrap around to the start of the buffer each time it reaches the end.
@@ -132,9 +130,6 @@ private:
     // It incorporates the base pitch rate, any sample-rate conversion factor from the buffer, and any doppler shift from an associated panner node.
     double totalPitchRate();
 
-    // m_lastGain provides continuity when we dynamically adjust the gain.
-    float m_lastGain;
-
     // We optionally keep track of a panner node which has a doppler shift that is incorporated into
     // the pitch rate. We manually manage ref-counting because we want to use RefTypeConnection.
     PannerNode* m_pannerNode;