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

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

Issue 16125005: Make new StreamController be async by default. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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
Index: sdk/lib/io/websocket_impl.dart
diff --git a/sdk/lib/io/websocket_impl.dart b/sdk/lib/io/websocket_impl.dart
index 77c3456f5f604a727fd3017cddd93a65908d50e8..45ef839c2f5db795efbc8f9a228c7377b3ae8121 100644
--- a/sdk/lib/io/websocket_impl.dart
+++ b/sdk/lib/io/websocket_impl.dart
@@ -93,7 +93,7 @@ class _WebSocketProtocolTransformer extends StreamEventTransformer {
throw new WebSocketException("Protocol error");
}
_currentMessageType = _WebSocketMessageType.TEXT;
- _controller = new StreamController();
+ _controller = new StreamController(sync: true);
_controller.stream
.transform(new Utf8DecoderTransformer(null))
.fold(new StringBuffer(), (buffer, str) => buffer..write(str))
@@ -109,7 +109,7 @@ class _WebSocketProtocolTransformer extends StreamEventTransformer {
throw new WebSocketException("Protocol error");
}
_currentMessageType = _WebSocketMessageType.BINARY;
- _controller = new StreamController();
+ _controller = new StreamController(sync: true);
_controller.stream
.fold(new _BufferList(), (buffer, data) => buffer..add(data))
.then((buffer) {
@@ -376,7 +376,7 @@ class _WebSocketPong {
class _WebSocketTransformerImpl implements WebSocketTransformer {
final StreamController<WebSocket> _controller =
- new StreamController<WebSocket>();
+ new StreamController<WebSocket>(sync: true);
Stream<WebSocket> bind(Stream<HttpRequest> stream) {
stream.listen((request) {
@@ -566,7 +566,7 @@ class _WebSocketConsumer implements StreamConsumer {
_ensureController() {
if (_controller != null) return;
- _controller = new StreamController(onPause: () => _subscription.pause(),
+ _controller = new StreamController(sync: true,onPause: () => _subscription.pause(),
floitsch 2013/05/30 12:13:48 new line missing.
Lasse Reichstein Nielsen 2013/05/31 05:51:59 Done.
onResume: () => _subscription.resume(),
onCancel: _onListen);
var stream = _controller.stream.transform(
@@ -628,7 +628,7 @@ class _WebSocketConsumer implements StreamConsumer {
class _WebSocketImpl extends Stream implements WebSocket {
- final StreamController _controller = new StreamController();
+ final StreamController _controller = new StreamController(sync: true);
StreamSink _sink;
final Socket _socket;

Powered by Google App Engine
This is Rietveld 408576698