Changeset 207672 in webkit
- Timestamp:
- Oct 21, 2016 9:09:28 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r207670 r207672 1 2016-10-21 Chris Dumez <cdumez@apple.com> 2 3 AudioNode.connect(): First parameter should not be nullable 4 https://bugs.webkit.org/show_bug.cgi?id=163773 5 6 Reviewed by Darin Adler. 7 8 Improve test coverage. 9 10 * webaudio/audionode-expected.txt: 11 * webaudio/audionode.html: 12 1 13 2016-10-21 Wenson Hsieh <wenson_hsieh@apple.com> 2 14 -
trunk/LayoutTests/webaudio/audionode-expected.txt
r205088 r207672 7 7 PASS Destination AudioNode has one input. 8 8 PASS Destination AudioNode has no outputs. 9 PASS connect() exception thrown for illegal destination AudioNode. 9 PASS audioNode.connect(0, 0, 0) threw exception TypeError: Argument 1 ('destination') to AudioNode.connect must be an instance of AudioNode. 10 PASS audioNode.connect(null, 0, 0) threw exception TypeError: Argument 1 ('destination') to AudioNode.connect must be an instance of AudioNode. 10 11 PASS connect() exception thrown for illegal output index. 11 12 PASS connect() exception thrown for illegal input index. -
trunk/LayoutTests/webaudio/audionode.html
r205088 r207672 52 52 // Try calling connect() method with illegal values. 53 53 54 try { 55 audioNode.connect(0, 0, 0); 56 testFailed("connect() exception should be thrown for illegal destination AudioNode."); 57 } catch(e) { 58 testPassed("connect() exception thrown for illegal destination AudioNode."); 59 } 54 shouldThrowErrorName("audioNode.connect(0, 0, 0)", "TypeError"); 55 shouldThrowErrorName("audioNode.connect(null, 0, 0)", "TypeError"); 60 56 61 57 try { -
trunk/Source/WebCore/ChangeLog
r207670 r207672 1 2016-10-21 Chris Dumez <cdumez@apple.com> 2 3 AudioNode.connect(): First parameter should not be nullable 4 https://bugs.webkit.org/show_bug.cgi?id=163773 5 6 Reviewed by Darin Adler. 7 8 AudioNode.connect()'s first parameter should not be nullable: 9 - https://webaudio.github.io/web-audio-api/#idl-def-AudioNode. 10 11 We were throwing a SYNTAX_ERR when passing null, we now throw 12 a TypeError instead. 13 14 No new tests, updated existing test. 15 16 * Modules/webaudio/AudioBasicInspectorNode.cpp: 17 (WebCore::AudioBasicInspectorNode::connect): 18 * Modules/webaudio/AudioBasicInspectorNode.h: 19 * Modules/webaudio/AudioNode.cpp: 20 (WebCore::AudioNode::connect): 21 * Modules/webaudio/AudioNode.h: 22 * Modules/webaudio/AudioNode.idl: 23 1 24 2016-10-21 Wenson Hsieh <wenson_hsieh@apple.com> 2 25 -
trunk/Source/WebCore/Modules/webaudio/AudioBasicInspectorNode.cpp
r207050 r207672 50 50 } 51 51 52 ExceptionOr<void> AudioBasicInspectorNode::connect(AudioNode *destination, unsigned outputIndex, unsigned inputIndex)52 ExceptionOr<void> AudioBasicInspectorNode::connect(AudioNode& destination, unsigned outputIndex, unsigned inputIndex) 53 53 { 54 54 ASSERT(isMainThread()); -
trunk/Source/WebCore/Modules/webaudio/AudioBasicInspectorNode.h
r207050 r207672 38 38 private: 39 39 void pullInputs(size_t framesToProcess) override; 40 ExceptionOr<void> connect(AudioNode *, unsigned outputIndex, unsigned inputIndex) override;40 ExceptionOr<void> connect(AudioNode&, unsigned outputIndex, unsigned inputIndex) override; 41 41 ExceptionOr<void> disconnect(unsigned outputIndex) override; 42 42 void checkNumberOfChannelsForInput(AudioNodeInput*) override; -
trunk/Source/WebCore/Modules/webaudio/AudioNode.cpp
r207050 r207672 124 124 } 125 125 126 ExceptionOr<void> AudioNode::connect(AudioNode *destination, unsigned outputIndex, unsigned inputIndex)126 ExceptionOr<void> AudioNode::connect(AudioNode& destination, unsigned outputIndex, unsigned inputIndex) 127 127 { 128 128 ASSERT(isMainThread()); 129 129 AudioContext::AutoLocker locker(context()); 130 131 if (!destination)132 return Exception { SYNTAX_ERR };133 130 134 131 // Sanity check input and output indices. … … 136 133 return Exception { INDEX_SIZE_ERR }; 137 134 138 if ( destination && inputIndex >= destination->numberOfInputs())135 if (inputIndex >= destination.numberOfInputs()) 139 136 return Exception { INDEX_SIZE_ERR }; 140 137 141 if (context() != destination ->context())138 if (context() != destination.context()) 142 139 return Exception { SYNTAX_ERR }; 143 140 144 auto* input = destination ->input(inputIndex);141 auto* input = destination.input(inputIndex); 145 142 auto* output = this->output(outputIndex); 146 143 input->connect(output); … … 152 149 } 153 150 154 ExceptionOr<void> AudioNode::connect(AudioParam *param, unsigned outputIndex)151 ExceptionOr<void> AudioNode::connect(AudioParam& param, unsigned outputIndex) 155 152 { 156 153 ASSERT(isMainThread()); 157 154 AudioContext::AutoLocker locker(context()); 158 155 159 if (!param)160 return Exception { SYNTAX_ERR };161 162 156 if (outputIndex >= numberOfOutputs()) 163 157 return Exception { INDEX_SIZE_ERR }; 164 158 165 if (context() != param ->context())159 if (context() != param.context()) 166 160 return Exception { SYNTAX_ERR }; 167 161 168 162 auto* output = this->output(outputIndex); 169 param ->connect(output);163 param.connect(output); 170 164 171 165 return { }; -
trunk/Source/WebCore/Modules/webaudio/AudioNode.h
r207050 r207672 122 122 123 123 // Called from main thread by corresponding JavaScript methods. 124 virtual ExceptionOr<void> connect(AudioNode *, unsigned outputIndex, unsigned inputIndex);125 ExceptionOr<void> connect(AudioParam *, unsigned outputIndex);124 virtual ExceptionOr<void> connect(AudioNode&, unsigned outputIndex, unsigned inputIndex); 125 ExceptionOr<void> connect(AudioParam&, unsigned outputIndex); 126 126 virtual ExceptionOr<void> disconnect(unsigned outputIndex); 127 127 -
trunk/Source/WebCore/Modules/webaudio/AudioNode.idl
r207050 r207672 35 35 [SetterMayThrowException] attribute DOMString channelInterpretation; 36 36 37 [MayThrowException] void connect(AudioNode ?destination, optional unsigned long output = 0, optional unsigned long input = 0);38 [MayThrowException] void connect(AudioParam ?destination, optional unsigned long output = 0);37 [MayThrowException] void connect(AudioNode destination, optional unsigned long output = 0, optional unsigned long input = 0); 38 [MayThrowException] void connect(AudioParam destination, optional unsigned long output = 0); 39 39 [MayThrowException] void disconnect(optional unsigned long output = 0); 40 40 };
Note: See TracChangeset
for help on using the changeset viewer.