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

Unified Diff: lib/html/dart2js/html_dart2js.dart

Side-by-side diff isn't available for this file because of its large size.
Issue 11358042: Make new audionode names backwards compatible. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
Download patch
« no previous file with comments | « no previous file | lib/html/dartium/html_dartium.dart » ('j') | lib/html/dartium/html_dartium.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/html/dart2js/html_dart2js.dart
===================================================================
--- lib/html/dart2js/html_dart2js.dart (revision 14418)
+++ lib/html/dart2js/html_dart2js.dart (working copy)
@@ -845,6 +845,9 @@
EventListenerList get complete;
}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
class _AudioContextImpl extends _EventTargetImpl implements AudioContext native "*AudioContext" {
@@ -879,8 +882,6 @@
_DynamicsCompressorNodeImpl createDynamicsCompressor() native;
- _GainNodeImpl createGain() native;
-
_MediaElementAudioSourceNodeImpl createMediaElementSource(_MediaElementImpl mediaElement) native;
_MediaStreamAudioSourceNodeImpl createMediaStreamSource(_MediaStreamImpl mediaStream) native;
@@ -889,8 +890,6 @@
_PannerNodeImpl createPanner() native;
- _ScriptProcessorNodeImpl createScriptProcessor(int bufferSize, [int numberOfInputChannels, int numberOfOutputChannels]) native;
-
_WaveShaperNodeImpl createWaveShaper() native;
_WaveTableImpl createWaveTable(_Float32ArrayImpl real, _Float32ArrayImpl imag) native;
@@ -898,6 +897,39 @@
void decodeAudioData(_ArrayBufferImpl audioData, AudioBufferCallback successCallback, [AudioBufferCallback errorCallback]) native;
void startRendering() native;
+
+ void createGain() {
+ if (JS('bool', '#.createGain !== undefined', this)) {
+ return JS('void', '#.createGain()', this);
+ } else {
+ return JS('void', '#.createGainNode()', this);
+ }
+ }
+
+ void createScriptProcessor(int bufferSize, [int numberOfInputChannels, int
+ numberOfOutputChannels]) {
+ if (JS('bool', '#.createScriptProcessor !== undefined', this)) {
+ if (?numberOfOutputChannels) {
+ return JS('void', '#.createScriptProcessor(#, #, #)', this, bufferSize,
+ numberOfInputChannels, numberOfOutputChannels);
+ } else if (?numberOfInputChannels) {
+ return JS('void', '#.createScriptProcessor(#, #)', this, bufferSize,
+ numberOfInputChannels);
+ } else {
+ return JS('void', '#.createScriptProcessor(#)', this, bufferSize);
+ }
+ } else {
+ if (?numberOfOutputChannels) {
+ return JS('void', '#.createJavaScriptNode(#, #, #)', this, bufferSize,
+ numberOfInputChannels, numberOfOutputChannels);
+ } else if (?numberOfInputChannels) {
+ return JS('void', '#.createJavaScriptNode(#, #)', this, bufferSize,
+ numberOfInputChannels);
+ } else {
+ return JS('void', '#.createJavaScriptNode(#)', this, bufferSize);
+ }
+ }
+ }
}
class _AudioContextEventsImpl extends _EventsImpl implements AudioContextEvents {
« no previous file with comments | « no previous file | lib/html/dartium/html_dartium.dart » ('j') | lib/html/dartium/html_dartium.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698