OLD | NEW |
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 const String _clientNoContextTakeover = "client_no_context_takeover"; | 8 const String _clientNoContextTakeover = "client_no_context_takeover"; |
9 const String _serverNoContextTakeover = "server_no_context_takeover"; | 9 const String _serverNoContextTakeover = "server_no_context_takeover"; |
10 const String _clientMaxWindowBits = "client_max_window_bits"; | 10 const String _clientMaxWindowBits = "client_max_window_bits"; |
(...skipping 1166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1177 | 1177 |
1178 int get readyState => _readyState; | 1178 int get readyState => _readyState; |
1179 | 1179 |
1180 String get extensions => null; | 1180 String get extensions => null; |
1181 int get closeCode => _closeCode; | 1181 int get closeCode => _closeCode; |
1182 String get closeReason => _closeReason; | 1182 String get closeReason => _closeReason; |
1183 | 1183 |
1184 void add(data) { _sink.add(data); } | 1184 void add(data) { _sink.add(data); } |
1185 void addUtf8Text(List<int> bytes) { | 1185 void addUtf8Text(List<int> bytes) { |
1186 if (bytes is! List<int>) { | 1186 if (bytes is! List<int>) { |
1187 throw new ArgumentError(bytes, "bytes", "Is not a list of bytes"); | 1187 throw new ArgumentError.value(bytes, "bytes", "Is not a list of bytes"); |
1188 } | 1188 } |
1189 _sink.add(new _EncodedString(bytes)); | 1189 _sink.add(new _EncodedString(bytes)); |
1190 } | 1190 } |
1191 void addError(error, [StackTrace stackTrace]) { | 1191 void addError(error, [StackTrace stackTrace]) { |
1192 _sink.addError(error, stackTrace); | 1192 _sink.addError(error, stackTrace); |
1193 } | 1193 } |
1194 Future addStream(Stream stream) => _sink.addStream(stream); | 1194 Future addStream(Stream stream) => _sink.addStream(stream); |
1195 Future get done => _sink.done; | 1195 Future get done => _sink.done; |
1196 | 1196 |
1197 Future close([int code, String reason]) { | 1197 Future close([int code, String reason]) { |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1268 return code != null && | 1268 return code != null && |
1269 (code < WebSocketStatus.NORMAL_CLOSURE || | 1269 (code < WebSocketStatus.NORMAL_CLOSURE || |
1270 code == WebSocketStatus.RESERVED_1004 || | 1270 code == WebSocketStatus.RESERVED_1004 || |
1271 code == WebSocketStatus.NO_STATUS_RECEIVED || | 1271 code == WebSocketStatus.NO_STATUS_RECEIVED || |
1272 code == WebSocketStatus.ABNORMAL_CLOSURE || | 1272 code == WebSocketStatus.ABNORMAL_CLOSURE || |
1273 (code > WebSocketStatus.INTERNAL_SERVER_ERROR && | 1273 (code > WebSocketStatus.INTERNAL_SERVER_ERROR && |
1274 code < WebSocketStatus.RESERVED_1015) || | 1274 code < WebSocketStatus.RESERVED_1015) || |
1275 (code >= WebSocketStatus.RESERVED_1015 && code < 3000)); | 1275 (code >= WebSocketStatus.RESERVED_1015 && code < 3000)); |
1276 } | 1276 } |
1277 } | 1277 } |
OLD | NEW |