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

Side by Side Diff: sdk/lib/web_audio/dartium/web_audio_dartium.dart

Issue 16125005: Make new StreamController be async by default. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 library dart.dom.web_audio; 1 library dart.dom.web_audio;
2 2
3 import 'dart:async'; 3 import 'dart:async';
4 import 'dart:collection'; 4 import 'dart:collection';
5 import 'dart:_collection-dev'; 5 import 'dart:_collection-dev';
6 import 'dart:html'; 6 import 'dart:html';
7 import 'dart:html_common'; 7 import 'dart:html_common';
8 import 'dart:nativewrappers'; 8 import 'dart:nativewrappers';
9 import 'dart:typed_data'; 9 import 'dart:typed_data';
10 // DO NOT EDIT 10 // DO NOT EDIT
(...skipping 1240 matching lines...) Expand 10 before | Expand all | Expand 10 after
1251 1251
1252 /** 1252 /**
1253 * Get a Stream that fires events when AudioProcessingEvents occur. 1253 * Get a Stream that fires events when AudioProcessingEvents occur.
1254 * This particular stream is special in that it only allows one listener to a 1254 * This particular stream is special in that it only allows one listener to a
1255 * given stream. Converting the returned Stream [asBroadcast] will likely ruin 1255 * given stream. Converting the returned Stream [asBroadcast] will likely ruin
1256 * the soft-real-time properties which which these events are fired and can 1256 * the soft-real-time properties which which these events are fired and can
1257 * be processed. 1257 * be processed.
1258 */ 1258 */
1259 Stream<AudioProcessingEvent> get onAudioProcess { 1259 Stream<AudioProcessingEvent> get onAudioProcess {
1260 if (_eventStream == null) { 1260 if (_eventStream == null) {
1261 var controller = new StreamController(); 1261 var controller = new StreamController(sync: true);
1262 var callback = (audioData) { 1262 var callback = (audioData) {
1263 if (controller.hasListener) { 1263 if (controller.hasListener) {
1264 // This stream is a strange combination of broadcast and single 1264 // This stream is a strange combination of broadcast and single
1265 // subscriber streams. We only allow one listener, but if there is 1265 // subscriber streams. We only allow one listener, but if there is
1266 // no listener, we don't queue up events, we just drop them on the 1266 // no listener, we don't queue up events, we just drop them on the
1267 // floor. 1267 // floor.
1268 controller.add(audioData); 1268 controller.add(audioData);
1269 } 1269 }
1270 }; 1270 };
1271 _setEventListener(callback); 1271 _setEventListener(callback);
1272 _eventStream = controller.stream; 1272 _eventStream = controller.stream;
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
1318 1318
1319 1319
1320 @DocsEditable 1320 @DocsEditable
1321 @DomName('WaveTable') 1321 @DomName('WaveTable')
1322 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#WaveTab le-section 1322 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#WaveTab le-section
1323 @Experimental 1323 @Experimental
1324 class WaveTable extends NativeFieldWrapperClass1 { 1324 class WaveTable extends NativeFieldWrapperClass1 {
1325 WaveTable.internal(); 1325 WaveTable.internal();
1326 1326
1327 } 1327 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698