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

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

Issue 12052038: Rename new Uri.fromString to Uri.parse. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Reupload because of Error. Created 7 years, 11 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/http_impl.dart ('k') | sdk/lib/uri/uri.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 748 matching lines...) Expand 10 before | Expand all | Expand 10 after
759 Function _onRequest; 759 Function _onRequest;
760 Function _onOpen; 760 Function _onOpen;
761 Function _onNoUpgrade; 761 Function _onNoUpgrade;
762 HttpClientConnection _conn; 762 HttpClientConnection _conn;
763 String _nonce; 763 String _nonce;
764 } 764 }
765 765
766 766
767 class _WebSocket implements WebSocket { 767 class _WebSocket implements WebSocket {
768 _WebSocket(String url, [protocols]) { 768 _WebSocket(String url, [protocols]) {
769 Uri uri = new Uri.fromString(url); 769 Uri uri = Uri.parse(url);
770 if (uri.scheme != "ws" && uri.scheme != "wss") { 770 if (uri.scheme != "ws" && uri.scheme != "wss") {
771 throw new WebSocketException("Unsupported URL scheme ${uri.scheme}"); 771 throw new WebSocketException("Unsupported URL scheme ${uri.scheme}");
772 } 772 }
773 if (uri.userInfo != "") { 773 if (uri.userInfo != "") {
774 throw new WebSocketException("Unsupported user info ${uri.userInfo}"); 774 throw new WebSocketException("Unsupported user info ${uri.userInfo}");
775 } 775 }
776 int port = uri.port == 0 ? HttpClient.DEFAULT_HTTP_PORT : uri.port; 776 int port = uri.port == 0 ? HttpClient.DEFAULT_HTTP_PORT : uri.port;
777 String path = uri.path; 777 String path = uri.path;
778 if (path.length == 0) path = "/"; 778 if (path.length == 0) path = "/";
779 if (uri.query != "") { 779 if (uri.query != "") {
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 867
868 class _WebSocketCloseEvent implements CloseEvent { 868 class _WebSocketCloseEvent implements CloseEvent {
869 _WebSocketCloseEvent(this._wasClean, this._code, this._reason); 869 _WebSocketCloseEvent(this._wasClean, this._code, this._reason);
870 bool get wasClean => _wasClean; 870 bool get wasClean => _wasClean;
871 int get code => _code; 871 int get code => _code;
872 String get reason => _reason; 872 String get reason => _reason;
873 bool _wasClean; 873 bool _wasClean;
874 int _code; 874 int _code;
875 String _reason; 875 String _reason;
876 } 876 }
OLDNEW
« no previous file with comments | « sdk/lib/io/http_impl.dart ('k') | sdk/lib/uri/uri.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698