Changeset 150810 in webkit
- Timestamp:
- May 28, 2013 10:54:20 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r150803 r150810 1 2013-05-28 Jer Noble <jer.noble@apple.com> 2 3 Made AudioNode an EventTarget 4 https://bugs.webkit.org/show_bug.cgi?id=116871 5 6 Reviewed by Darin Adler. 7 8 * webaudio/audionode-expected.txt: 9 * webaudio/audionode.html: 10 1 11 2013-05-28 Sergio Villar Senin <svillar@igalia.com> 2 12 -
trunk/LayoutTests/webaudio/audionode-expected.txt
r137516 r150810 17 17 PASS exception thrown when connecting to other context's node. 18 18 PASS exception thrown when creating audio context with not enough arguments. 19 PASS AudioNode is an EventTarget 19 20 PASS successfullyParsed is true 20 21 -
trunk/LayoutTests/webaudio/audionode.html
r121877 r150810 102 102 } 103 103 104 // Ensure it is an EventTarget 105 try { 106 audioNode.addEventListener('testEvent', function(){ 107 testPassed("AudioNode is an EventTarget"); 108 }); 109 audioNode.dispatchEvent(new Event('testEvent')); 110 } catch(e) { 111 testFailed("exception shouldn't be thrown when testing whether audio node is an event target"); 112 } 113 104 114 finishJSTest(); 105 115 } -
trunk/Source/WebCore/ChangeLog
r150809 r150810 1 2013-05-28 Jer Noble <jer.noble@apple.com> 2 3 Made AudioNode an EventTarget 4 https://bugs.webkit.org/show_bug.cgi?id=116871 5 6 Merge: https://chromium.googlesource.com/chromium/blink/+/ef37484162ddb95d677dcfdcdd778ec60590928b 7 8 Reviewed by Darin Adler. 9 10 Tests: webaudio/audionode-expected.txt: 11 webaudio/audionode.html: 12 13 Add the requisite boilerplate to allow AudioNode to become an EventTarget. Remove 14 all that same boilerplate from ScriptProcessorNode now that it's base class 15 is an EventTarget. 16 17 * Modules/webaudio/AudioNode.cpp: 18 (WebCore::AudioNode::interfaceName): Added boilerplate. 19 (WebCore::AudioNode::scriptExecutionContext): Return the AudioContext's context. 20 (WebCore::AudioNode::processIfNecessary): Whitespace. 21 * Modules/webaudio/AudioNode.h: 22 * Modules/webaudio/AudioNode.idl: Make AudioNode an EventTarget. 23 * Modules/webaudio/ScriptProcessorNode.cpp: Remove EventTarget boilerplate. 24 * Modules/webaudio/ScriptProcessorNode.h: Ditto. 25 * Modules/webaudio/ScriptProcessorNode.idl: Ditto. 26 * dom/EventTarget.h: Mark AudioNode as an EventTarget. 27 * dom/EventTargetFactory.in: Ditto. 28 1 29 2013-05-28 Arvid Nilsson <anilsson@rim.com> 2 30 -
trunk/Source/WebCore/Modules/webaudio/AudioNode.cpp
r148921 r150810 281 281 } 282 282 283 const AtomicString& AudioNode::interfaceName() const 284 { 285 return eventNames().interfaceForAudioNode; 286 } 287 288 ScriptExecutionContext* AudioNode::scriptExecutionContext() const 289 { 290 return const_cast<AudioNode*>(this)->context()->scriptExecutionContext(); 291 } 292 283 293 void AudioNode::processIfNecessary(size_t framesToProcess) 284 294 { 285 295 ASSERT(context()->isAudioThread()); 286 296 287 297 if (!isInitialized()) 288 298 return; -
trunk/Source/WebCore/Modules/webaudio/AudioNode.h
r148921 r150810 27 27 28 28 #include "AudioBus.h" 29 #include "EventTarget.h" 29 30 #include <wtf/Forward.h> 30 31 #include <wtf/OwnPtr.h> … … 50 51 // Most processing nodes such as filters will have one input and one output, although multiple inputs and outputs are possible. 51 52 52 class AudioNode {53 class AudioNode : public EventTarget { 53 54 public: 54 55 enum { ProcessingSizeInFrames = 128 }; … … 179 180 AudioBus::ChannelInterpretation internalChannelInterpretation() const { return m_channelInterpretation; } 180 181 182 // EventTarget 183 virtual const AtomicString& interfaceName() const OVERRIDE; 184 virtual ScriptExecutionContext* scriptExecutionContext() const OVERRIDE; 185 virtual EventTargetData* eventTargetData() OVERRIDE { return &m_eventTargetData; } 186 virtual EventTargetData* ensureEventTargetData() OVERRIDE { return &m_eventTargetData; } 187 181 188 protected: 182 189 // Inputs and outputs must be created before the AudioNode is initialized. … … 200 207 Vector<OwnPtr<AudioNodeOutput> > m_outputs; 201 208 209 EventTargetData m_eventTargetData; 210 202 211 double m_lastProcessingTime; 203 212 double m_lastNonSilentTime; … … 215 224 #endif 216 225 226 virtual void refEventTarget() OVERRIDE { ref(); } 227 virtual void derefEventTarget() OVERRIDE { deref(); } 228 217 229 protected: 218 230 unsigned m_channelCount; -
trunk/Source/WebCore/Modules/webaudio/AudioNode.idl
r149920 r150810 24 24 25 25 [ 26 Conditional=WEB_AUDIO 27 ] interface AudioNode { 26 Conditional=WEB_AUDIO, 27 JSGenerateToJSObject, 28 JSGenerateToNativeObject, 29 GenerateIsReachable=Impl, 30 EventTarget 31 ] interface AudioNode : EventTarget { 28 32 readonly attribute AudioContext context; 29 33 readonly attribute unsigned long numberOfInputs; … … 47 51 void disconnect([Default=Undefined] optional unsigned long output) 48 52 raises(DOMException); 53 54 void addEventListener(DOMString type, EventListener listener, optional boolean useCapture); 55 56 void removeEventListener(DOMString type, EventListener listener, optional boolean useCapture); 57 58 boolean dispatchEvent(Event event) 59 raises(EventException); 49 60 }; -
trunk/Source/WebCore/Modules/webaudio/ScriptProcessorNode.cpp
r149817 r150810 264 264 } 265 265 266 const AtomicString& ScriptProcessorNode::interfaceName() const267 {268 return eventNames().interfaceForScriptProcessorNode;269 }270 271 ScriptExecutionContext* ScriptProcessorNode::scriptExecutionContext() const272 {273 return const_cast<ScriptProcessorNode*>(this)->context()->scriptExecutionContext();274 }275 276 266 double ScriptProcessorNode::tailTime() const 277 267 { -
trunk/Source/WebCore/Modules/webaudio/ScriptProcessorNode.h
r149817 r150810 48 48 // AudioBuffers for each input and output. 49 49 50 // FIXME: EventTarget should be introduced at the base of the inheritance hierarchy (i.e., as a base class for AudioNode). 51 class ScriptProcessorNode : public AudioNode, public EventTarget { 50 class ScriptProcessorNode : public AudioNode { 52 51 public: 53 52 // bufferSize must be one of the following values: 256, 512, 1024, 2048, 4096, 8192, 16384. … … 65 64 virtual void uninitialize(); 66 65 67 // EventTarget68 virtual const AtomicString& interfaceName() const;69 virtual ScriptExecutionContext* scriptExecutionContext() const;70 virtual EventTargetData* eventTargetData() { return &m_eventTargetData; }71 virtual EventTargetData* ensureEventTargetData() { return &m_eventTargetData; }72 73 66 size_t bufferSize() const { return m_bufferSize; } 74 67 75 68 DEFINE_ATTRIBUTE_EVENT_LISTENER(audioprocess); 76 77 // Reconcile ref/deref which are defined both in AudioNode and EventTarget.78 using AudioNode::ref;79 using AudioNode::deref;80 69 81 70 private: … … 96 85 Vector<RefPtr<AudioBuffer> > m_outputBuffers; 97 86 98 virtual void refEventTarget() { ref(); }99 virtual void derefEventTarget() { deref(); }100 EventTargetData m_eventTargetData;101 102 87 size_t m_bufferSize; 103 88 unsigned m_bufferReadWriteIndex; -
trunk/Source/WebCore/Modules/webaudio/ScriptProcessorNode.idl
r149920 r150810 27 27 Conditional=WEB_AUDIO, 28 28 JSGenerateToJSObject, 29 JSGenerateToNativeObject, 30 EventTarget 29 JSGenerateToNativeObject 31 30 ] interface ScriptProcessorNode : AudioNode { 32 31 // Rendering callback 33 32 attribute EventListener onaudioprocess; 34 33 35 34 readonly attribute long bufferSize; 36 35 }; -
trunk/Source/WebCore/dom/EventTarget.h
r149173 r150810 41 41 namespace WebCore { 42 42 43 class AudioNode; 43 44 class AudioContext; 44 45 class AudioTrackList; -
trunk/Source/WebCore/dom/EventTargetFactory.in
r149999 r150810 1 1 namespace="EventTarget" 2 2 3 AudioNode conditional=WEB_AUDIO 3 4 AudioContext conditional=WEB_AUDIO 4 5 AudioTrackList conditional=VIDEO_TRACK … … 15 16 IDBRequest conditional=INDEXED_DATABASE 16 17 IDBTransaction conditional=INDEXED_DATABASE 17 ScriptProcessorNode conditional=WEB_AUDIO18 18 LocalMediaStream conditional=MEDIA_STREAM 19 19 MediaKeySession conditional=ENCRYPTED_MEDIA_V2
Note: See TracChangeset
for help on using the changeset viewer.