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

Unified Diff: sdk/lib/web_audio/dart2js/web_audio_dart2js.dart

Issue 19018006: Convert decodeAudioData to return a Future. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sdk/lib/web_audio/dartium/web_audio_dartium.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/web_audio/dart2js/web_audio_dart2js.dart
diff --git a/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart b/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart
index bbb4d835b957ded2734c21042ed7c2c500e1848f..e0651962137a9b65a67f2abc215df2e4dace743c 100644
--- a/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart
+++ b/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart
@@ -326,9 +326,21 @@ class AudioContext extends EventTarget native "AudioContext" {
@DocsEditable()
WaveTable createWaveTable(Float32List real, Float32List imag) native;
+ @JSName('decodeAudioData')
@DomName('AudioContext.decodeAudioData')
@DocsEditable()
- void decodeAudioData(ByteBuffer audioData, AudioBufferCallback successCallback, [AudioBufferCallback errorCallback]) native;
+ void _decodeAudioData(ByteBuffer audioData, AudioBufferCallback successCallback, [AudioBufferCallback errorCallback]) native;
+
+ @JSName('decodeAudioData')
+ @DomName('AudioContext.decodeAudioData')
+ @DocsEditable()
+ Future<AudioBuffer> decodeAudioData(ByteBuffer audioData) {
+ var completer = new Completer<AudioBuffer>();
+ _decodeAudioData(audioData,
+ (value) { completer.complete(value); },
+ (error) { completer.completeError(error); });
+ return completer.future;
+ }
@DomName('AudioContext.startRendering')
@DocsEditable()
« no previous file with comments | « no previous file | sdk/lib/web_audio/dartium/web_audio_dartium.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698