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

Unified Diff: sdk/lib/io/http_parser.dart

Issue 16125005: Make new StreamController be async by default. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review comments Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/io/http_impl.dart ('k') | sdk/lib/io/io_sink.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/http_parser.dart
diff --git a/sdk/lib/io/http_parser.dart b/sdk/lib/io/http_parser.dart
index b7aabd2074e11d107cabed6e6646fd3c95b7dd77..8edaa0c66c2d50b6992c81848f51a9b1d346846a 100644
--- a/sdk/lib/io/http_parser.dart
+++ b/sdk/lib/io/http_parser.dart
@@ -107,6 +107,7 @@ class _HttpDetachedIncoming extends Stream<List<int>> {
_HttpDetachedIncoming(StreamSubscription this.subscription,
List<int> this.carryOverData) {
controller = new StreamController<List<int>>(
+ sync: true,
onListen: resume,
onPause: pause,
onResume: resume,
@@ -195,24 +196,25 @@ class _HttpParser
_HttpParser._(this._requestParser) {
_controller = new StreamController<_HttpIncoming>(
- onListen: () {
- _socketSubscription.resume();
- _paused = false;
- },
- onPause: () {
- _paused = true;
- _pauseStateChanged();
- },
- onResume: () {
- _paused = false;
- _pauseStateChanged();
- },
- onCancel: () {
- try {
- _socketSubscription.cancel();
- } catch (e) {
- }
- });
+ sync: true,
+ onListen: () {
+ _socketSubscription.resume();
+ _paused = false;
+ },
+ onPause: () {
+ _paused = true;
+ _pauseStateChanged();
+ },
+ onResume: () {
+ _paused = false;
+ _pauseStateChanged();
+ },
+ onCancel: () {
+ try {
+ _socketSubscription.cancel();
+ } catch (e) {
+ }
+ });
_reset();
}
@@ -883,6 +885,7 @@ class _HttpParser
assert(!_bodyPaused);
var incoming;
_bodyController = new StreamController<List<int>>(
+ sync: true,
onListen: () {
if (incoming != _incoming) return;
assert(_bodyPaused);
« no previous file with comments | « sdk/lib/io/http_impl.dart ('k') | sdk/lib/io/io_sink.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698