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

Unified Diff: sdk/lib/io/websocket.dart

Issue 266653002: Further code review changes for WebSocket.fromUpgradedSocket. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/standalone/io/web_socket_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/websocket.dart
diff --git a/sdk/lib/io/websocket.dart b/sdk/lib/io/websocket.dart
index a35ca3e5eb6852ee9698561b39c463d9e7230d6e..386671da5d4ca2053103cf6fd01cfc3579166bd9 100644
--- a/sdk/lib/io/websocket.dart
+++ b/sdk/lib/io/websocket.dart
@@ -144,13 +144,18 @@ abstract class WebSocket implements Stream, StreamSink {
*
* [protocol] should be the protocol negotiated by this handshake, if any.
*
- * If [serverSide] is `false`, the WebSocket will act as the client and mask
- * the messages it sends. If it's `true`, it will act as the server and will
- * not mask its messages.
+ * [serverSide] must be passed explicitly. If it's `false`, the WebSocket will
+ * act as the client and mask the messages it sends. If it's `true`, it will
+ * act as the server and will not mask its messages.
*/
factory WebSocket.fromUpgradedSocket(Socket socket, {String protocol,
- bool serverSide: true}) =>
- new _WebSocketImpl._fromSocket(socket, protocol, serverSide);
+ bool serverSide}) {
+ if (serverSide == null) {
+ throw new ArgumentError("The serverSide argument must be passed "
+ "explicitly to WebSocket.fromUpgradedSocket.");
+ }
+ return new _WebSocketImpl._fromSocket(socket, protocol, serverSide);
+ }
/**
* Returns the current state of the connection.
« no previous file with comments | « no previous file | tests/standalone/io/web_socket_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698