Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(379)

Issue 8873008: Added constructor for AudioContext for dartc and frog (Closed)

Created:
9 years ago by vsm
Modified:
9 years ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Added constructor for AudioContext for dartc and frog Committed: https://code.google.com/p/dart/source/detail?r=2225

Patch Set 1 #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+41 lines, -1 line) Patch
M client/dom/frog/frog_dom.dart View 1 chunk +2 lines, -0 lines 0 comments Download
M client/dom/generated/src/frog/AudioContext.dart View 1 chunk +2 lines, -0 lines 2 comments Download
M client/dom/generated/src/interface/AudioContext.dart View 1 chunk +3 lines, -1 line 0 comments Download
M client/dom/generated/wrapping_dom.js View 1 chunk +8 lines, -0 lines 0 comments Download
M client/dom/scripts/dartgenerator.py View 1 chunk +1 line, -0 lines 0 comments Download
A client/dom/scripts/template_interface_AudioContext.darttemplate View 1 chunk +10 lines, -0 lines 0 comments Download
M client/dom/scripts/template_wrapping_dom.js View 1 chunk +8 lines, -0 lines 1 comment Download
M client/dom/src/_FactoryProviders.dart View 1 chunk +7 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
vsm
9 years ago (2011-12-08 04:53:59 UTC) #1
Jennifer Messerly
lgtm
9 years ago (2011-12-08 05:11:49 UTC) #2
sra1
A rudimentary test case would be helpful. I suggest a layout test that calls the ...
9 years ago (2011-12-08 06:19:16 UTC) #3
Jennifer Messerly
http://codereview.chromium.org/8873008/diff/1/client/dom/generated/src/frog/AudioContext.dart File client/dom/generated/src/frog/AudioContext.dart (right): http://codereview.chromium.org/8873008/diff/1/client/dom/generated/src/frog/AudioContext.dart#newcode3 client/dom/generated/src/frog/AudioContext.dart:3: AudioContext() native; On 2011/12/08 06:19:16, sra1 wrote: > It ...
9 years ago (2011-12-08 06:31:21 UTC) #4
sra1
9 years ago (2011-12-08 07:29:14 UTC) #5
On 2011/12/08 06:31:21, John Messerly wrote:
>
http://codereview.chromium.org/8873008/diff/1/client/dom/generated/src/frog/A...
> File client/dom/generated/src/frog/AudioContext.dart (right):
> 
>
http://codereview.chromium.org/8873008/diff/1/client/dom/generated/src/frog/A...
> client/dom/generated/src/frog/AudioContext.dart:3: AudioContext() native;
> On 2011/12/08 06:19:16, sra1 wrote:
> > It is slightly strange to have a plain constructor for a hidden type.  I
> looked
> > at the unified browser info and AudioContext is 'hidden' on *all* our target
> > browsers.
> > 
> > The WebKit IDL for DOMWindow contains
> >         attribute [JSCCustomGetter,Conditional=WEB_AUDIO,EnabledAtRuntime]
> > AudioContextConstructor webkitAudioContext; // Usable with new operator
> > 
> > which will appear in the JavaScript global scope.
> > 
> > So the constructor should be:
> > 
> > factory AudioContext() native @'return new webkitAudioContext();';
> > 
> > The dartc version also needs to call the right constructor.
> 
> If "webkitAudioContext" is the constructor, why not just make that the native
> type name?
> It's nice to make things non-hidden when possible.

But it is even nicer to make things standard.

The WebKit IDL declares the type as AudioContext.
w3c describes AudioContext:
https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AudioCo...
They are not the same but are on a path to being the same, and have a lot of
common functionality.
Many things called webkitXXX are on a path to being called XXX.

> 
> I tried this out, worked great:
> $ webkitAudioContext
> function AudioContext() { [native code] }
> $ webkitAudioContext.prototype.hello = function(){console.log("hello");}
> $ new webkitAudioContext().hello
> function (){console.log("hello");}
> $ new webkitAudioContext().hello()
> hello
> $ new webkitAudioContext() instanceof webkitAudioContext
> true

Powered by Google App Engine
This is Rietveld 408576698