Title: [236831] trunk/Source/WebCore
Revision
236831
Author
[email protected]
Date
2018-10-04 09:20:24 -0700 (Thu, 04 Oct 2018)

Log Message

AudioNode.connect should use [ReturnValue]
https://bugs.webkit.org/show_bug.cgi?id=190231

Reviewed by Eric Carlson.

This is a slightly more efficient way to return a value that is always
identical to one of the arguments, so use it here.

* Modules/webaudio/AudioBasicInspectorNode.cpp:
(WebCore::AudioBasicInspectorNode::connect): Return ExceptionOr<void>.
* Modules/webaudio/AudioBasicInspectorNode.h: Ditto.
* Modules/webaudio/AudioNode.cpp:
(WebCore::AudioNode::connect): Ditto.
* Modules/webaudio/AudioNode.h: Ditto.

* Modules/webaudio/AudioNode.idl: Use [ReturnValue].

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (236830 => 236831)


--- trunk/Source/WebCore/ChangeLog	2018-10-04 15:37:56 UTC (rev 236830)
+++ trunk/Source/WebCore/ChangeLog	2018-10-04 16:20:24 UTC (rev 236831)
@@ -1,3 +1,22 @@
+2018-10-02  Darin Adler  <[email protected]>
+
+        AudioNode.connect should use [ReturnValue]
+        https://bugs.webkit.org/show_bug.cgi?id=190231
+
+        Reviewed by Eric Carlson.
+
+        This is a slightly more efficient way to return a value that is always
+        identical to one of the arguments, so use it here.
+
+        * Modules/webaudio/AudioBasicInspectorNode.cpp:
+        (WebCore::AudioBasicInspectorNode::connect): Return ExceptionOr<void>.
+        * Modules/webaudio/AudioBasicInspectorNode.h: Ditto.
+        * Modules/webaudio/AudioNode.cpp:
+        (WebCore::AudioNode::connect): Ditto.
+        * Modules/webaudio/AudioNode.h: Ditto.
+
+        * Modules/webaudio/AudioNode.idl: Use [ReturnValue].
+
 2018-10-03  Justin Michaud  <[email protected]>
 
         Registered custom properties should allow inheritance to be controlled

Modified: trunk/Source/WebCore/Modules/webaudio/AudioBasicInspectorNode.cpp (236830 => 236831)


--- trunk/Source/WebCore/Modules/webaudio/AudioBasicInspectorNode.cpp	2018-10-04 15:37:56 UTC (rev 236830)
+++ trunk/Source/WebCore/Modules/webaudio/AudioBasicInspectorNode.cpp	2018-10-04 16:20:24 UTC (rev 236831)
@@ -49,7 +49,7 @@
     input(0)->pull(output(0)->bus(), framesToProcess);
 }
 
-ExceptionOr<AudioNode&> AudioBasicInspectorNode::connect(AudioNode& destination, unsigned outputIndex, unsigned inputIndex)
+ExceptionOr<void> AudioBasicInspectorNode::connect(AudioNode& destination, unsigned outputIndex, unsigned inputIndex)
 {
     ASSERT(isMainThread());
 

Modified: trunk/Source/WebCore/Modules/webaudio/AudioBasicInspectorNode.h (236830 => 236831)


--- trunk/Source/WebCore/Modules/webaudio/AudioBasicInspectorNode.h	2018-10-04 15:37:56 UTC (rev 236830)
+++ trunk/Source/WebCore/Modules/webaudio/AudioBasicInspectorNode.h	2018-10-04 16:20:24 UTC (rev 236831)
@@ -37,7 +37,7 @@
 
 private:
     void pullInputs(size_t framesToProcess) override;
-    ExceptionOr<AudioNode&> connect(AudioNode&, unsigned outputIndex, unsigned inputIndex) override;
+    ExceptionOr<void> connect(AudioNode&, unsigned outputIndex, unsigned inputIndex) override;
     ExceptionOr<void> disconnect(unsigned outputIndex) override;
     void checkNumberOfChannelsForInput(AudioNodeInput*) override;
 

Modified: trunk/Source/WebCore/Modules/webaudio/AudioNode.cpp (236830 => 236831)


--- trunk/Source/WebCore/Modules/webaudio/AudioNode.cpp	2018-10-04 15:37:56 UTC (rev 236830)
+++ trunk/Source/WebCore/Modules/webaudio/AudioNode.cpp	2018-10-04 16:20:24 UTC (rev 236831)
@@ -122,7 +122,7 @@
     return nullptr;
 }
 
-ExceptionOr<AudioNode&> AudioNode::connect(AudioNode& destination, unsigned outputIndex, unsigned inputIndex)
+ExceptionOr<void> AudioNode::connect(AudioNode& destination, unsigned outputIndex, unsigned inputIndex)
 {
     ASSERT(isMainThread()); 
     AudioContext::AutoLocker locker(context());
@@ -144,7 +144,7 @@
     // Let context know that a connection has been made.
     context().incrementConnectionCount();
 
-    return destination;
+    return { };
 }
 
 ExceptionOr<void> AudioNode::connect(AudioParam& param, unsigned outputIndex)

Modified: trunk/Source/WebCore/Modules/webaudio/AudioNode.h (236830 => 236831)


--- trunk/Source/WebCore/Modules/webaudio/AudioNode.h	2018-10-04 15:37:56 UTC (rev 236830)
+++ trunk/Source/WebCore/Modules/webaudio/AudioNode.h	2018-10-04 16:20:24 UTC (rev 236831)
@@ -123,7 +123,7 @@
     AudioNodeOutput* output(unsigned);
 
     // Called from main thread by corresponding _javascript_ methods.
-    virtual ExceptionOr<AudioNode&> connect(AudioNode&, unsigned outputIndex, unsigned inputIndex);
+    virtual ExceptionOr<void> connect(AudioNode&, unsigned outputIndex, unsigned inputIndex);
     ExceptionOr<void> connect(AudioParam&, unsigned outputIndex);
     virtual ExceptionOr<void> disconnect(unsigned outputIndex);
 

Modified: trunk/Source/WebCore/Modules/webaudio/AudioNode.idl (236830 => 236831)


--- trunk/Source/WebCore/Modules/webaudio/AudioNode.idl	2018-10-04 15:37:56 UTC (rev 236830)
+++ trunk/Source/WebCore/Modules/webaudio/AudioNode.idl	2018-10-04 16:20:24 UTC (rev 236831)
@@ -34,7 +34,7 @@
     attribute DOMString channelCountMode;
     attribute DOMString channelInterpretation;
 
-    [MayThrowException] AudioNode connect(AudioNode destination, optional unsigned long output = 0, optional unsigned long input = 0);
+    [MayThrowException] AudioNode connect([ReturnValue] AudioNode destination, optional unsigned long output = 0, optional unsigned long input = 0);
     [MayThrowException] void connect(AudioParam destination, optional unsigned long output = 0);
     [MayThrowException] void disconnect(optional unsigned long output = 0);
 };
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to