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

Side by Side Diff: runtime/bin/websocket_impl.dart

Issue 10832145: Add a ListOutputStream.onData callback. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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 | « runtime/bin/list_stream_impl.dart ('k') | tests/standalone/io/list_input_stream_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 final String _webSocketGUID = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"; 5 final String _webSocketGUID = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
6 6
7 class _WebSocketMessageType { 7 class _WebSocketMessageType {
8 static final int NONE = 0; 8 static final int NONE = 0;
9 static final int BINARY = 1; 9 static final int BINARY = 1;
10 static final int TEXT = 2; 10 static final int TEXT = 2;
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 } else { 496 } else {
497 _outputStream.write(buffer.getRange(offset, count)); 497 _outputStream.write(buffer.getRange(offset, count));
498 } 498 }
499 } 499 }
500 500
501 _onWebSocketMessageEnd() { 501 _onWebSocketMessageEnd() {
502 if (_onMessage != null) { 502 if (_onMessage != null) {
503 if (_currentMessageType == _WebSocketMessageType.TEXT) { 503 if (_currentMessageType == _WebSocketMessageType.TEXT) {
504 _onMessage(_decoder.decoded); 504 _onMessage(_decoder.decoded);
505 } else { 505 } else {
506 _onMessage(_outputStream.contents()); 506 _onMessage(_outputStream.read());
507 } 507 }
508 } 508 }
509 _decoder = null; 509 _decoder = null;
510 _outputStream = null; 510 _outputStream = null;
511 } 511 }
512 512
513 _onWebSocketPing(List<int> payload) { 513 _onWebSocketPing(List<int> payload) {
514 _sendFrame(_WebSocketOpcode.PONG, payload); 514 _sendFrame(_WebSocketOpcode.PONG, payload);
515 } 515 }
516 516
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
881 881
882 class _WebSocketCloseEvent implements CloseEvent { 882 class _WebSocketCloseEvent implements CloseEvent {
883 _WebSocketCloseEvent(this._wasClean, this._code, this._reason); 883 _WebSocketCloseEvent(this._wasClean, this._code, this._reason);
884 bool get wasClean() => _wasClean; 884 bool get wasClean() => _wasClean;
885 int get code() => _code; 885 int get code() => _code;
886 String get reason() => _reason; 886 String get reason() => _reason;
887 bool _wasClean; 887 bool _wasClean;
888 int _code; 888 int _code;
889 String _reason; 889 String _reason;
890 } 890 }
OLDNEW
« no previous file with comments | « runtime/bin/list_stream_impl.dart ('k') | tests/standalone/io/list_input_stream_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698