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

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

Issue 11740027: Rename unsubscribe to cancel. (Closed) Base URL: https://dart.googlecode.com/svn/experimental/lib_v2/dart
Patch Set: Address comments. Created 7 years, 11 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
« no previous file with comments | « sdk/lib/async/stream_impl.dart ('k') | tests/lib/async/stream_controller_async_test.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 /** 7 /**
8 * A pipe between two streams. 8 * A pipe between two streams.
9 * 9 *
10 * The default pipe subscribes to the [source] and sends on the 10 * The default pipe subscribes to the [source] and sends on the
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 * [stream] has subscribers. 49 * [stream] has subscribers.
50 */ 50 */
51 void _onSubscriptionStateChange() { 51 void _onSubscriptionStateChange() {
52 if (_hasSubscribers) { 52 if (_hasSubscribers) {
53 assert(_subscription == null); 53 assert(_subscription == null);
54 if (_source != null) { 54 if (_source != null) {
55 _subscribeToSource(); 55 _subscribeToSource();
56 } 56 }
57 } else { 57 } else {
58 if (_subscription != null) { 58 if (_subscription != null) {
59 _subscription.unsubscribe(); 59 _subscription.cancel();
60 _subscription = null; 60 _subscription = null;
61 } 61 }
62 } 62 }
63 } 63 }
64 64
65 void _onPauseStateChange() { 65 void _onPauseStateChange() {
66 if (_subscription == null) return; 66 if (_subscription == null) return;
67 if (isPaused) { 67 if (isPaused) {
68 _subscription.pause(); 68 _subscription.pause();
69 } else { 69 } else {
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 _signalError(new AsyncError(e, s)); 451 _signalError(new AsyncError(e, s));
452 return null; 452 return null;
453 } 453 }
454 if (!isEqual) { 454 if (!isEqual) {
455 _add(inputEvent); 455 _add(inputEvent);
456 _previous = inputEvent; 456 _previous = inputEvent;
457 } 457 }
458 } 458 }
459 } 459 }
460 } 460 }
OLDNEW
« no previous file with comments | « sdk/lib/async/stream_impl.dart ('k') | tests/lib/async/stream_controller_async_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698