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

Side by Side Diff: third_party/WebKit/Source/modules/webaudio/AudioScheduledSourceNode.h

Issue 2471353004: Implement AudioScheduledSourceNode (Closed)
Patch Set: Rebaseline test Created 3 years, 11 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 12 matching lines...) Expand all
23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */ 27 */
28 28
29 #ifndef AudioScheduledSourceNode_h 29 #ifndef AudioScheduledSourceNode_h
30 #define AudioScheduledSourceNode_h 30 #define AudioScheduledSourceNode_h
31 31
32 #include "bindings/core/v8/ActiveScriptWrappable.h" 32 #include "bindings/core/v8/ActiveScriptWrappable.h"
33 #include "modules/webaudio/AudioSourceNode.h" 33 #include "modules/webaudio/AudioNode.h"
34 34
35 namespace blink { 35 namespace blink {
36 36
37 class BaseAudioContext; 37 class BaseAudioContext;
38 class AudioBus; 38 class AudioBus;
39 39
40 class AudioScheduledSourceHandler : public AudioHandler { 40 class AudioScheduledSourceHandler : public AudioHandler {
41 public: 41 public:
42 // These are the possible states an AudioScheduledSourceNode can be in: 42 // These are the possible states an AudioScheduledSourceNode can be in:
43 // 43 //
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 118
119 static const double UnknownTime; 119 static const double UnknownTime;
120 120
121 private: 121 private:
122 // This is accessed by both the main thread and audio thread. Use the setter 122 // This is accessed by both the main thread and audio thread. Use the setter
123 // and getter to protect the access to this. 123 // and getter to protect the access to this.
124 int m_playbackState; 124 int m_playbackState;
125 }; 125 };
126 126
127 class AudioScheduledSourceNode 127 class AudioScheduledSourceNode
128 : public AudioSourceNode, 128 : public AudioNode,
129 public ActiveScriptWrappable<AudioScheduledSourceNode> { 129 public ActiveScriptWrappable<AudioScheduledSourceNode> {
130 USING_GARBAGE_COLLECTED_MIXIN(AudioScheduledSourceNode); 130 USING_GARBAGE_COLLECTED_MIXIN(AudioScheduledSourceNode);
131 DEFINE_WRAPPERTYPEINFO();
131 132
132 public: 133 public:
133 void start(ExceptionState&); 134 void start(ExceptionState&);
134 void start(double when, ExceptionState&); 135 void start(double when, ExceptionState&);
135 void stop(ExceptionState&); 136 void stop(ExceptionState&);
136 void stop(double when, ExceptionState&); 137 void stop(double when, ExceptionState&);
137 138
138 EventListener* onended(); 139 EventListener* onended();
139 void setOnended(EventListener*); 140 void setOnended(EventListener*);
140 141
141 // ScriptWrappable: 142 // ScriptWrappable:
142 bool hasPendingActivity() const final; 143 bool hasPendingActivity() const final;
143 144
144 DEFINE_INLINE_VIRTUAL_TRACE() { AudioSourceNode::trace(visitor); } 145 DEFINE_INLINE_VIRTUAL_TRACE() { AudioNode::trace(visitor); }
145 146
146 protected: 147 protected:
147 explicit AudioScheduledSourceNode(BaseAudioContext&); 148 explicit AudioScheduledSourceNode(BaseAudioContext&);
148 AudioScheduledSourceHandler& audioScheduledSourceHandler() const; 149 AudioScheduledSourceHandler& audioScheduledSourceHandler() const;
149 }; 150 };
150 151
151 } // namespace blink 152 } // namespace blink
152 153
153 #endif // AudioScheduledSourceNode_h 154 #endif // AudioScheduledSourceNode_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698