Bug 75402 - Use overload methods to implement [Optional] parameters in AudioNode.idl
Summary: Use overload methods to implement [Optional] parameters in AudioNode.idl
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Audio (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Raymond
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-30 21:37 PST by Raymond
Modified: 2012-01-01 12:56 PST (History)
7 users (show)

See Also:


Attachments
Patch (18.79 KB, patch)
2011-12-30 21:40 PST, Raymond
abarth: review+
webkit.review.bot: commit-queue-
Details | Formatted Diff | Diff
Patch (18.72 KB, patch)
2011-12-31 19:36 PST, Raymond
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Raymond 2011-12-30 21:37:08 PST
Use overload methods to implement [Optional] parameters in AudioNode.idl
Comment 1 Raymond 2011-12-30 21:40:44 PST
Created attachment 120826 [details]
Patch
Comment 2 Adam Barth 2011-12-30 21:52:37 PST
Comment on attachment 120826 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=120826&action=review

Looks great!  Thanks.

> Source/WebCore/webaudio/AudioNode.h:122
> +    void connect(AudioNode*, ExceptionCode&);
> +    void connect(AudioNode*, unsigned outputIndex, ExceptionCode&);
> +    void connect(AudioNode*, unsigned outputIndex, unsigned inputIndex, ExceptionCode&);
> +    void disconnect(ExceptionCode&);
> +    void disconnect(unsigned outputIndex, ExceptionCode&);

You can use [Optional=CallWithDefaultValue] if you don't want to create all these symbols.
Comment 3 Raymond 2011-12-30 22:03:30 PST
(In reply to comment #2)

> 
> > Source/WebCore/webaudio/AudioNode.h:122
> > +    void connect(AudioNode*, ExceptionCode&);
> > +    void connect(AudioNode*, unsigned outputIndex, ExceptionCode&);
> > +    void connect(AudioNode*, unsigned outputIndex, unsigned inputIndex, ExceptionCode&);
> > +    void disconnect(ExceptionCode&);
> > +    void disconnect(unsigned outputIndex, ExceptionCode&);
> 
> You can use [Optional=CallWithDefaultValue] if you don't want to create all these symbols.

Oh,really! That's great, I will update the patch
Comment 4 WebKit Review Bot 2011-12-30 22:36:30 PST
Comment on attachment 120826 [details]
Patch

Attachment 120826 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/10954356

New failing tests:
webaudio/mediaelementaudiosourcenode.html
webaudio/audionode.html
Comment 5 Raymond 2011-12-30 23:14:52 PST
(In reply to comment #4)
> (From update of attachment 120826 [details])
> Attachment 120826 [details] did not pass chromium-ews (chromium-xvfb):
> Output: http://queues.webkit.org/results/10954356
> 
> New failing tests:
> webaudio/mediaelementaudiosourcenode.html
> webaudio/audionode.html

hmm, it seems that the connect function can take a 0 for destination, so that disconnect will utilize it. While it won't take a 0 for destination from JS space as the test page try to verify. But the Web Audio Spec don't specify that destination node should not be 0. But anyway, to try to find a solution for this...
Comment 6 Raymond 2011-12-31 19:36:54 PST
Created attachment 120839 [details]
Patch
Comment 7 Raymond 2011-12-31 19:52:02 PST
Failed to set up Layout test env locally ( can not link the DumpRenderTree on my ubuntu 11.10 ...). But managed to load all the LayoutTest/webaudio/ test pages manually. It seems the test been passed. 

While I also observe that, some test page will pass and fail randomly from time to time ( not related to connect, mainly pages related to offline context creation, and failed at the point of create context, if one fails, all the other similar pages fail. If one success, all the others success too) either with or without this patch.  Strange. Maybe it's my local env's issue?
Comment 8 Adam Barth 2012-01-01 10:43:35 PST
> Strange. Maybe it's my local env's issue?

Not sure.  I don't know much about web audio.
Comment 9 WebKit Review Bot 2012-01-01 12:56:43 PST
Comment on attachment 120839 [details]
Patch

Clearing flags on attachment: 120839

Committed r103882: <http://trac.webkit.org/changeset/103882>
Comment 10 WebKit Review Bot 2012-01-01 12:56:48 PST
All reviewed patches have been landed.  Closing bug.