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

Side by Side Diff: lib/shelf_web_socket.dart

Issue 1758123002: Use the web_socket_channel package. (Closed) Base URL: git@github.com:dart-lang/shelf_web_socket@master
Patch Set: Created 4 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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 import 'package:http_parser/http_parser.dart'; 5 import 'package:web_socket_channel/web_socket_channel.dart';
kevmoo 2016/03/03 00:50:50 sorting?
nweiz 2016/03/03 20:08:22 Done.
6 import 'package:shelf/shelf.dart'; 6 import 'package:shelf/shelf.dart';
7 7
8 import 'src/web_socket_handler.dart'; 8 import 'src/web_socket_handler.dart';
9 9
10 /// A typedef used to determine if a function takes two arguments or not. 10 /// A typedef used to determine if a function takes two arguments or not.
11 typedef _BinaryFunction(arg1, arg2); 11 typedef _BinaryFunction(arg1, arg2);
12 12
13 /// Creates a Shelf handler that upgrades HTTP requests to WebSocket 13 /// Creates a Shelf handler that upgrades HTTP requests to WebSocket
14 /// connections. 14 /// connections.
15 /// 15 ///
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 throw new ArgumentError("If protocols is non-null, onConnection must " 51 throw new ArgumentError("If protocols is non-null, onConnection must "
52 "take two arguments, the WebSocket and the protocol."); 52 "take two arguments, the WebSocket and the protocol.");
53 } 53 }
54 54
55 var innerOnConnection = onConnection; 55 var innerOnConnection = onConnection;
56 onConnection = (webSocket, _) => innerOnConnection(webSocket); 56 onConnection = (webSocket, _) => innerOnConnection(webSocket);
57 } 57 }
58 58
59 return new WebSocketHandler(onConnection, protocols, allowedOrigins).handle; 59 return new WebSocketHandler(onConnection, protocols, allowedOrigins).handle;
60 } 60 }
OLDNEW
« no previous file with comments | « CHANGELOG.md ('k') | lib/src/web_socket_handler.dart » ('j') | lib/src/web_socket_handler.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698