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

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

Issue 2767943002: Revert "Fix some strong mode issues in the core libraries." (Closed)
Patch Set: Created 3 years, 9 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
« no previous file with comments | « CHANGELOG.md ('k') | sdk/lib/collection/queue.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 // ------------------------------------------------------------------- 7 // -------------------------------------------------------------------
8 // Core Stream types 8 // Core Stream types
9 // ------------------------------------------------------------------- 9 // -------------------------------------------------------------------
10 10
(...skipping 1296 matching lines...) Expand 10 before | Expand all | Expand 10 after
1307 if (onTimeout == null) { 1307 if (onTimeout == null) {
1308 timeout = () { 1308 timeout = () {
1309 controller.addError( 1309 controller.addError(
1310 new TimeoutException("No stream event", timeLimit), null); 1310 new TimeoutException("No stream event", timeLimit), null);
1311 }; 1311 };
1312 } else { 1312 } else {
1313 // TODO(floitsch): the return type should be 'void', and the type 1313 // TODO(floitsch): the return type should be 'void', and the type
1314 // should be inferred. 1314 // should be inferred.
1315 var registeredOnTimeout = 1315 var registeredOnTimeout =
1316 zone.registerUnaryCallback<dynamic, EventSink<T>>(onTimeout); 1316 zone.registerUnaryCallback<dynamic, EventSink<T>>(onTimeout);
1317 var wrapper = new _ControllerEventSinkWrapper<T>(null); 1317 _ControllerEventSinkWrapper wrapper =
1318 new _ControllerEventSinkWrapper(null);
1318 timeout = () { 1319 timeout = () {
1319 wrapper._sink = controller; // Only valid during call. 1320 wrapper._sink = controller; // Only valid during call.
1320 zone.runUnaryGuarded(registeredOnTimeout, wrapper); 1321 zone.runUnaryGuarded(registeredOnTimeout, wrapper);
1321 wrapper._sink = null; 1322 wrapper._sink = null;
1322 }; 1323 };
1323 } 1324 }
1324 1325
1325 subscription = this.listen(onData, onError: onError, onDone: onDone); 1326 subscription = this.listen(onData, onError: onError, onDone: onDone);
1326 timer = zone.createTimer(timeLimit, timeout); 1327 timer = zone.createTimer(timeLimit, timeout);
1327 } 1328 }
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
1788 } 1789 }
1789 1790
1790 void addError(error, [StackTrace stackTrace]) { 1791 void addError(error, [StackTrace stackTrace]) {
1791 _sink.addError(error, stackTrace); 1792 _sink.addError(error, stackTrace);
1792 } 1793 }
1793 1794
1794 void close() { 1795 void close() {
1795 _sink.close(); 1796 _sink.close();
1796 } 1797 }
1797 } 1798 }
OLDNEW
« no previous file with comments | « CHANGELOG.md ('k') | sdk/lib/collection/queue.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698