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

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

Issue 23479014: Add case to please the analyzer (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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 | « no previous file | no next file » | 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 848 matching lines...) Expand 10 before | Expand all | Expand 10 after
859 859
860 Future close([int code, String reason]) { 860 Future close([int code, String reason]) {
861 if (!_writeClosed) { 861 if (!_writeClosed) {
862 if (_isReservedStatusCode(code)) { 862 if (_isReservedStatusCode(code)) {
863 throw new WebSocketException("Reserved status code $code"); 863 throw new WebSocketException("Reserved status code $code");
864 } 864 }
865 _outCloseCode = code; 865 _outCloseCode = code;
866 _outCloseReason = reason; 866 _outCloseReason = reason;
867 _writeClosed = true; 867 _writeClosed = true;
868 } 868 }
869 if (!_sink._isBound) _sink.close(); 869 if (!(_sink as _StreamSinkImpl)._isBound) _sink.close();
870 return _sink.done; 870 return _sink.done;
871 } 871 }
872 872
873 static bool _isReservedStatusCode(int code) { 873 static bool _isReservedStatusCode(int code) {
874 return code != null && 874 return code != null &&
875 (code < WebSocketStatus.NORMAL_CLOSURE || 875 (code < WebSocketStatus.NORMAL_CLOSURE ||
876 code == WebSocketStatus.RESERVED_1004 || 876 code == WebSocketStatus.RESERVED_1004 ||
877 code == WebSocketStatus.NO_STATUS_RECEIVED || 877 code == WebSocketStatus.NO_STATUS_RECEIVED ||
878 code == WebSocketStatus.ABNORMAL_CLOSURE || 878 code == WebSocketStatus.ABNORMAL_CLOSURE ||
879 (code > WebSocketStatus.INTERNAL_SERVER_ERROR && 879 (code > WebSocketStatus.INTERNAL_SERVER_ERROR &&
880 code < WebSocketStatus.RESERVED_1015) || 880 code < WebSocketStatus.RESERVED_1015) ||
881 (code >= WebSocketStatus.RESERVED_1015 && 881 (code >= WebSocketStatus.RESERVED_1015 &&
882 code < 3000)); 882 code < 3000));
883 } 883 }
884 } 884 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698