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

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

Issue 16131003: Reapply "Active stream subscriptions". (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Patch from sgjesse fixing file descriptor error. 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
« no previous file with comments | « sdk/lib/async/stream_pipe.dart ('k') | sdk/lib/io/http_parser.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 class _HttpIncoming extends Stream<List<int>> { 7 class _HttpIncoming extends Stream<List<int>> {
8 final int _transferLength; 8 final int _transferLength;
9 final Completer _dataCompleter = new Completer(); 9 final Completer _dataCompleter = new Completer();
10 Stream<List<int>> _stream; 10 Stream<List<int>> _stream;
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 StreamController _controller; 555 StreamController _controller;
556 StreamSubscription _subscription; 556 StreamSubscription _subscription;
557 Completer _closeCompleter = new Completer(); 557 Completer _closeCompleter = new Completer();
558 Completer _completer; 558 Completer _completer;
559 bool _socketError = false; 559 bool _socketError = false;
560 560
561 _HttpOutboundConsumer(_HttpOutboundMessage this._outbound); 561 _HttpOutboundConsumer(_HttpOutboundMessage this._outbound);
562 562
563 void _cancel() { 563 void _cancel() {
564 if (_subscription != null) { 564 if (_subscription != null) {
565 _subscription.cancel(); 565 StreamSubscription subscription = _subscription;
566 _subscription = null;
567 subscription.cancel();
566 } 568 }
567 } 569 }
568 570
569 _ensureController() { 571 _ensureController() {
570 if (_controller != null) return; 572 if (_controller != null) return;
571 _controller = new StreamController(onPause: () => _subscription.pause(), 573 _controller = new StreamController(onPause: () => _subscription.pause(),
572 onResume: () => _subscription.resume(), 574 onResume: () => _subscription.resume(),
573 onListen: () => _subscription.resume(), 575 onListen: () => _subscription.resume(),
574 onCancel: _cancel); 576 onCancel: _cancel);
575 _outbound._addStream(_controller.stream) 577 _outbound._addStream(_controller.stream)
(...skipping 1760 matching lines...) Expand 10 before | Expand all | Expand 10 after
2336 2338
2337 2339
2338 class _RedirectInfo implements RedirectInfo { 2340 class _RedirectInfo implements RedirectInfo {
2339 const _RedirectInfo(int this.statusCode, 2341 const _RedirectInfo(int this.statusCode,
2340 String this.method, 2342 String this.method,
2341 Uri this.location); 2343 Uri this.location);
2342 final int statusCode; 2344 final int statusCode;
2343 final String method; 2345 final String method;
2344 final Uri location; 2346 final Uri location;
2345 } 2347 }
OLDNEW
« no previous file with comments | « sdk/lib/async/stream_pipe.dart ('k') | sdk/lib/io/http_parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698