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

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

Issue 12504006: Make IOSink implement StringSink (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed second round of review comments Created 7 years, 9 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/string_transformer.dart ('k') | tests/standalone/debugger/debug_lib.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 const String _webSocketGUID = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"; 7 const String _webSocketGUID = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
8 8
9 class _WebSocketMessageType { 9 class _WebSocketMessageType {
10 static const int NONE = 0; 10 static const int NONE = 0;
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 } else if (dataLength > 125) { 652 } else if (dataLength > 125) {
653 header[index++] = 126; 653 header[index++] = 126;
654 lengthBytes = 2; 654 lengthBytes = 2;
655 } 655 }
656 // Write the length in network byte order into the header. 656 // Write the length in network byte order into the header.
657 for (int i = 0; i < lengthBytes; i++) { 657 for (int i = 0; i < lengthBytes; i++) {
658 header[index++] = dataLength >> (((lengthBytes - 1) - i) * 8) & 0xFF; 658 header[index++] = dataLength >> (((lengthBytes - 1) - i) * 8) & 0xFF;
659 } 659 }
660 assert(index == headerSize); 660 assert(index == headerSize);
661 try { 661 try {
662 _socket.add(header); 662 _socket.writeBytes(header);
663 if (data != null) { 663 if (data != null) {
664 _socket.add(data); 664 _socket.writeBytes(data);
665 } 665 }
666 } catch (_) { 666 } catch (_) {
667 // The socket can be closed before _socket.done have a chance 667 // The socket can be closed before _socket.done have a chance
668 // to complete. 668 // to complete.
669 _writeClosed = true; 669 _writeClosed = true;
670 } 670 }
671 } 671 }
672 } 672 }
OLDNEW
« no previous file with comments | « sdk/lib/io/string_transformer.dart ('k') | tests/standalone/debugger/debug_lib.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698