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

Side by Side Diff: sdk/lib/io/io_sink.dart

Issue 14103010: Change hasSubscribers to hasListener. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed comments. Created 7 years, 8 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/io/http_parser.dart ('k') | sdk/lib/io/secure_server_socket.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.io; 5 part of dart.io;
6 6
7 /** 7 /**
8 * Helper class to wrap a [StreamConsumer<List<int>>] and provide 8 * Helper class to wrap a [StreamConsumer<List<int>>] and provide
9 * utility functions for writing to the StreamConsumer directly. The 9 * utility functions for writing to the StreamConsumer directly. The
10 * [IOSink] buffers the input given by [write], [writeAll], [writeln], 10 * [IOSink] buffers the input given by [write], [writeAll], [writeln],
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 if (_bindSubscription != null) { 229 if (_bindSubscription != null) {
230 try { 230 try {
231 // The subscription can be canceled at this point. 231 // The subscription can be canceled at this point.
232 _bindSubscription.resume(); 232 _bindSubscription.resume();
233 } catch (e) { 233 } catch (e) {
234 } 234 }
235 } 235 }
236 } 236 }
237 237
238 void _onSubscriptionStateChange() { 238 void _onSubscriptionStateChange() {
239 if (_controller.hasSubscribers) { 239 if (_controller.hasListener) {
240 _paused = false; 240 _paused = false;
241 _resume(); 241 _resume();
242 } else { 242 } else {
243 if (_bindSubscription != null) { 243 if (_bindSubscription != null) {
244 _bindSubscription.cancel(); 244 _bindSubscription.cancel();
245 _bindSubscription = null; 245 _bindSubscription = null;
246 } 246 }
247 } 247 }
248 } 248 }
249 249
(...skipping 14 matching lines...) Expand all
264 }, 264 },
265 onError: _controller.addError); 265 onError: _controller.addError);
266 if (_paused) _pause(); 266 if (_paused) _pause();
267 if (unbind) { 267 if (unbind) {
268 return _writeStreamCompleter.future; 268 return _writeStreamCompleter.future;
269 } else { 269 } else {
270 return _pipeFuture; 270 return _pipeFuture;
271 } 271 }
272 } 272 }
273 } 273 }
OLDNEW
« no previous file with comments | « sdk/lib/io/http_parser.dart ('k') | sdk/lib/io/secure_server_socket.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698