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

Side by Side Diff: sdk/lib/async/broadcast_stream_controller.dart

Issue 48483002: Remove deprecated parts of dart:async. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comment. Created 7 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:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/async/async_error.dart ('k') | sdk/lib/async/future_impl.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of dart.async; 5 part of dart.async;
6 6
7 class _BroadcastStream<T> extends _ControllerStream<T> { 7 class _BroadcastStream<T> extends _ControllerStream<T> {
8 _BroadcastStream(_StreamControllerLifecycle controller) : super(controller); 8 _BroadcastStream(_StreamControllerLifecycle controller) : super(controller);
9 9
10 bool get isBroadcast => true; 10 bool get isBroadcast => true;
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 return new StateError("Cannot add new events while doing an addStream"); 213 return new StateError("Cannot add new events while doing an addStream");
214 } 214 }
215 215
216 void add(T data) { 216 void add(T data) {
217 if (!_mayAddEvent) throw _addEventError(); 217 if (!_mayAddEvent) throw _addEventError();
218 _sendData(data); 218 _sendData(data);
219 } 219 }
220 220
221 void addError(Object error, [StackTrace stackTrace]) { 221 void addError(Object error, [StackTrace stackTrace]) {
222 if (!_mayAddEvent) throw _addEventError(); 222 if (!_mayAddEvent) throw _addEventError();
223 if (stackTrace != null) _attachStackTrace(error, stackTrace);
224 _sendError(error, stackTrace); 223 _sendError(error, stackTrace);
225 } 224 }
226 225
227 Future close() { 226 Future close() {
228 if (isClosed) { 227 if (isClosed) {
229 assert(_doneFuture != null); 228 assert(_doneFuture != null);
230 return _doneFuture; 229 return _doneFuture;
231 } 230 }
232 if (!_mayAddEvent) throw _addEventError(); 231 if (!_mayAddEvent) throw _addEventError();
233 _state |= _STATE_CLOSED; 232 _state |= _STATE_CLOSED;
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 _pauseCount++; 468 _pauseCount++;
470 } 469 }
471 void resume() { _resume(null); } 470 void resume() { _resume(null); }
472 void _resume(_) { 471 void _resume(_) {
473 if (_pauseCount > 0) _pauseCount--; 472 if (_pauseCount > 0) _pauseCount--;
474 } 473 }
475 Future cancel() { return new _Future.immediate(null); } 474 Future cancel() { return new _Future.immediate(null); }
476 bool get isPaused => _pauseCount > 0; 475 bool get isPaused => _pauseCount > 0;
477 Future asFuture([Object value]) => new _Future(); 476 Future asFuture([Object value]) => new _Future();
478 } 477 }
OLDNEW
« no previous file with comments | « sdk/lib/async/async_error.dart ('k') | sdk/lib/async/future_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698