Bug 97050

Summary: Add Web Audio support for deprecated/legacy APIs
Product: WebKit Reporter: Chris Rogers <crogers>
Component: New BugsAssignee: Chris Rogers <crogers>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, eric.carlson, feature-media-reviews, gtk-ews, gustavo, gyuyoung.kim, ojan, pnormand, rakuco, webkit.review.bot, xan.lopez, zan
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 98635    
Attachments:
Description Flags
Patch
none
GTK build fix
none
Patch
none
Patch
none
Patch eric.carlson: review+

Description Chris Rogers 2012-09-18 15:24:23 PDT
Add Web Audio support for deprecated/legacy APIs
Comment 1 Chris Rogers 2012-09-18 15:31:33 PDT
Created attachment 164630 [details]
Patch
Comment 2 kov's GTK+ EWS bot 2012-09-18 15:37:48 PDT
Comment on attachment 164630 [details]
Patch

Attachment 164630 [details] did not pass gtk-ews (gtk):
Output: http://queues.webkit.org/results/13892338
Comment 3 Philippe Normand 2012-09-18 23:19:25 PDT
I'll have a look at the GTK failure.
Comment 4 Adam Barth 2012-09-18 23:27:28 PDT
Comment on attachment 164630 [details]
Patch

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

Any chance of renaming JavaScriptAudioNode to ScriptAudioNode / createJavaScriptNode to createScriptNode ?

> Source/WebCore/Modules/webaudio/Oscillator.idl:59
> +#if defined(ENABLE_LEGACY_WEB_AUDIO) && ENABLE_LEGACY_WEB_AUDIO
>          void noteOn(in double when);
>          void noteOff(in double when);
> +#endif

Do you want to add a V8MeasureAs IDL attribute to measure how often these old APIs are used?  See http://lists.webkit.org/pipermail/webkit-dev/2012-September/022239.html
Comment 5 Chris Rogers 2012-09-18 23:45:48 PDT
Adam, thanks for having such a quick look:

(In reply to comment #4)
> (From update of attachment 164630 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=164630&action=review
> 
> Any chance of renaming JavaScriptAudioNode to ScriptAudioNode / createJavaScriptNode to createScriptNode ?

Yes, there is a good chance now with this deprecation path.



> 
> > Source/WebCore/Modules/webaudio/Oscillator.idl:59
> > +#if defined(ENABLE_LEGACY_WEB_AUDIO) && ENABLE_LEGACY_WEB_AUDIO
> >          void noteOn(in double when);
> >          void noteOff(in double when);
> > +#endif
> 
> Do you want to add a V8MeasureAs IDL attribute to measure how often these old APIs are used?  See http://lists.webkit.org/pipermail/webkit-dev/2012-September/022239.html

I think we already know the answer:  noteOn()/noteOff() are effectively always going to be used,  So this would add little value.
Comment 6 Philippe Normand 2012-09-19 00:21:36 PDT
Created attachment 164676 [details]
GTK build fix
Comment 7 Philippe Normand 2012-09-19 00:22:22 PDT
+Zan in CC because he works on the GTK build system these days.
Comment 8 Zan Dobersek 2012-09-19 05:00:54 PDT
Comment on attachment 164676 [details]
GTK build fix

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

> configure.ac:714
> +AC_MSG_CHECKING([whether to enable legacy Web Audio support])

I'd say the configuration option isn't required. The feature define seems to be enabled by default, so I'd say add it to GNUmakefile.features.am (as done in this patch) and override it with 0 value in GNUmakefile.am if Web Audio is not enabled. I can upload that patch after we get to consensus on whether the configuration option should be present or not.
Comment 9 Philippe Normand 2012-09-19 05:38:06 PDT
Comment on attachment 164676 [details]
GTK build fix

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

>> configure.ac:714
>> +AC_MSG_CHECKING([whether to enable legacy Web Audio support])
> 
> I'd say the configuration option isn't required. The feature define seems to be enabled by default, so I'd say add it to GNUmakefile.features.am (as done in this patch) and override it with 0 value in GNUmakefile.am if Web Audio is not enabled. I can upload that patch after we get to consensus on whether the configuration option should be present or not.

Well it depends if we'll ever build with webaudio on and legacy off I guess. No strong opinion on the command line switch. About setting the define to 0 if webaudio is disabled I think it's not needed because the code in ENABLE_LEGACY_WEB_AUDIO is protected by ENABLE_WEB_AUDIO already.
Comment 10 Zan Dobersek 2012-09-19 06:11:02 PDT
Comment on attachment 164676 [details]
GTK build fix

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

>>> configure.ac:714
>>> +AC_MSG_CHECKING([whether to enable legacy Web Audio support])
>> 
>> I'd say the configuration option isn't required. The feature define seems to be enabled by default, so I'd say add it to GNUmakefile.features.am (as done in this patch) and override it with 0 value in GNUmakefile.am if Web Audio is not enabled. I can upload that patch after we get to consensus on whether the configuration option should be present or not.
> 
> Well it depends if we'll ever build with webaudio on and legacy off I guess. No strong opinion on the command line switch. About setting the define to 0 if webaudio is disabled I think it's not needed because the code in ENABLE_LEGACY_WEB_AUDIO is protected by ENABLE_WEB_AUDIO already.

I'd then recommend not using the configuration option and having ENABLE_LEGACY_WEB_AUDIO default to 0. The issue should be revisited when Web Audio is enabled by default for the GTK port.

I'd recommend overriding the feature define with 0 just for sanity and in case in the future there are changes made that are guarded by this define but not the ENABLE_WEB_AUDIO define.
Comment 11 Zan Dobersek 2012-09-19 06:24:05 PDT
(In reply to comment #10)
> 
> I'd recommend overriding the feature define with 0 just for sanity and in case in the future there are changes made that are guarded by this define but not the ENABLE_WEB_AUDIO define.

After looking at the patch more closely I believe the feature define should be enabled by default, but no configuration option is necessary.

Basically, this means that the GTK port only requires Source/WebCore/GNUmakefile.features.am to be modified in the same way as Philippe had done it in attachment #164676 [details].
Comment 12 Adam Barth 2012-09-19 11:49:14 PDT
> > (From update of attachment 164630 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=164630&action=review
> > 
> > > Source/WebCore/Modules/webaudio/Oscillator.idl:59
> > > +#if defined(ENABLE_LEGACY_WEB_AUDIO) && ENABLE_LEGACY_WEB_AUDIO
> > >          void noteOn(in double when);
> > >          void noteOff(in double when);
> > > +#endif
> > 
> > Do you want to add a V8MeasureAs IDL attribute to measure how often these old APIs are used?  See http://lists.webkit.org/pipermail/webkit-dev/2012-September/022239.html
> 
> I think we already know the answer:  noteOn()/noteOff() are effectively always going to be used,  So this would add little value.

Today, perhaps, but we'll eventually want to be able to delete these functions.  To do that, won't we want to know when their usage drops below a certain level?
Comment 13 Chris Rogers 2012-09-20 16:43:17 PDT
Created attachment 165011 [details]
Patch
Comment 14 Chris Rogers 2012-09-20 17:12:16 PDT
Created attachment 165017 [details]
Patch
Comment 15 Chris Rogers 2012-09-20 18:29:43 PDT
abarth: I added V8MeasureAs

I've simplified the GTK changes - did I get that part right?
Comment 16 Philippe Normand 2012-09-20 23:19:06 PDT
(In reply to comment #15)
> 
> I've simplified the GTK changes - did I get that part right?

Yes!
Comment 17 Adam Barth 2012-09-21 09:07:27 PDT
Comment on attachment 165017 [details]
Patch

V8MeasureAs part looks great!
Comment 18 Eric Carlson 2012-09-21 09:42:41 PDT
Comment on attachment 165017 [details]
Patch

What is the plan for updating tests? It seems like it would be a good idea to update at least a few now to verify the name changes.
Comment 19 Chris Rogers 2012-09-21 13:15:31 PDT
Created attachment 165177 [details]
Patch
Comment 20 Chris Rogers 2012-09-21 13:16:50 PDT
(In reply to comment #18)
> (From update of attachment 165017 [details])
> What is the plan for updating tests? It seems like it would be a good idea to update at least a few now to verify the name changes.

Eric, good point.  I updated a few of the tests to use the new names.  I think fairly soon we should switch all of the tests to use the new names.
Comment 21 Eric Carlson 2012-09-21 13:22:13 PDT
Comment on attachment 165177 [details]
Patch

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

> Source/WebCore/ChangeLog:12
> +        Reviewed by NOBODY (OOPS!).
> +
> +        The Web Audio API specification has undergone much review and some small API changes
> +        have been made (mostly naming-related changes).  This patch adds an ENABLE_LEGACY_WEB_AUDIO
> +        build option to allow ports to support the old names.
> +
> +        * Configurations/FeatureDefines.xcconfig:

Please make a note of the tests you updated.
Comment 22 Chris Rogers 2012-09-21 15:12:20 PDT
Committed r129260: <http://trac.webkit.org/changeset/129260>
Comment 23 Pavel Podivilov 2012-09-25 08:44:50 PDT
Comment on attachment 165177 [details]
Patch

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

> Source/WebCore/Modules/webaudio/AudioBufferSourceNode.idl:48
> +        [V8MeasureAs=WebAudioStart] [ImplementedAs=startGrain] void start(in double when, in double grainOffset, in double grainDuration);

It should be [V8MeasureAs=WebAudioStart, ImplementedAs=startGrain] according to web idl syntax. See http://dev.w3.org/2006/webapi/WebIDL/#idl-extended-attributes.