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

Side by Side Diff: runtime/bin/websocket.dart

Issue 10254001: Add websocket files to dummy io.dart implementation for dart2js. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix code blocks Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « lib/compiler/implementation/lib/io.dart ('k') | 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 /** 5 /**
6 * The web socket protocol is implemented by a HTTP server handler 6 * The web socket protocol is implemented by a HTTP server handler
7 * which can be instantiated like this: 7 * which can be instantiated like this:
8 * 8 *
9 * WebSocketHandler wsHandler = new WebSocketHandler(); 9 * WebSocketHandler wsHandler = new WebSocketHandler();
ahe 2012/04/27 09:27:45 Code samples should be wrapped in [:CODE_HERE:].
Mads Ager (google) 2012/04/27 09:29:50 Yes, I know. But that will look horrible with the
Bob Nystrom 2012/04/27 18:06:37 I think what Mads is doing here is fine. The inden
10 * 10 *
11 * and then its onRequest method can be assigned to the HTTP server, e.g. 11 * and then its onRequest method can be assigned to the HTTP server, e.g.
12 * 12 *
13 * server.defaultHandler = wsHandler.onRequest; 13 * server.defaultHandler = wsHandler.onRequest;
14 * 14 *
15 * or 15 * or
16 * 16 *
17 * server.addRequestHandler((req) => reg.path == "/ws", wsHandler.onRequest); 17 * server.addRequestHandler((req) => req.path == "/ws",
18 * 18 * wsHandler.onRequest);
19 */ 19 */
20 interface WebSocketHandler default _WebSocketHandler { 20 interface WebSocketHandler default _WebSocketHandler {
21 WebSocketHandler(); 21 WebSocketHandler();
22 22
23 /** 23 /**
24 * Request handler to be registered with the HTTP server. 24 * Request handler to be registered with the HTTP server.
25 */ 25 */
26 void onRequest(HttpRequest request, HttpResponse response); 26 void onRequest(HttpRequest request, HttpResponse response);
27 27
28 /** 28 /**
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 */ 69 */
70 close([int status, String reason]); 70 close([int status, String reason]);
71 } 71 }
72 72
73 73
74 class WebSocketException implements Exception { 74 class WebSocketException implements Exception {
75 const WebSocketException([String this.message = ""]); 75 const WebSocketException([String this.message = ""]);
76 String toString() => "WebSocketException: $message"; 76 String toString() => "WebSocketException: $message";
77 final String message; 77 final String message;
78 } 78 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/lib/io.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698