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

Side by Side Diff: samples/chat/chat_server_lib.dart

Issue 9653026: Add writeString method to OutputStream (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased Created 8 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 | Annotate | Revision Log
« no previous file with comments | « runtime/bin/string_stream.dart ('k') | samples/chat/chat_stress_client.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) 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 #library("chat_server"); 5 #library("chat_server");
6 #import("dart:io"); 6 #import("dart:io");
7 #import("dart:isolate"); 7 #import("dart:isolate");
8 #import("dart:json"); 8 #import("dart:json");
9 9
10 typedef void RequestHandler(HttpRequest request, HttpResponse response); 10 typedef void RequestHandler(HttpRequest request, HttpResponse response);
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 static final String notFoundPageHtml = """ 324 static final String notFoundPageHtml = """
325 <html><head> 325 <html><head>
326 <title>404 Not Found</title> 326 <title>404 Not Found</title>
327 </head><body> 327 </head><body>
328 <h1>Not Found</h1> 328 <h1>Not Found</h1>
329 <p>The requested URL was not found on this server.</p> 329 <p>The requested URL was not found on this server.</p>
330 </body></html>"""; 330 </body></html>""";
331 331
332 void _sendJSONResponse(HttpResponse response, Map responseData) { 332 void _sendJSONResponse(HttpResponse response, Map responseData) {
333 response.setHeader("Content-Type", "application/json; charset=UTF-8"); 333 response.setHeader("Content-Type", "application/json; charset=UTF-8");
334 response.writeString(JSON.stringify(responseData)); 334 response.outputStream.writeString(JSON.stringify(responseData));
335 response.outputStream.close(); 335 response.outputStream.close();
336 } 336 }
337 337
338 IsolatedServer() : super() { 338 IsolatedServer() : super() {
339 _requestHandlers = new Map(); 339 _requestHandlers = new Map();
340 } 340 }
341 341
342 void redirectPageHandler(HttpRequest request, 342 void redirectPageHandler(HttpRequest request,
343 HttpResponse response, 343 HttpResponse response,
344 String redirectPath) { 344 String redirectPath) {
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
709 } 709 }
710 } 710 }
711 711
712 int _timeRange; 712 int _timeRange;
713 List<int> _buckets; 713 List<int> _buckets;
714 int _currentBucket; 714 int _currentBucket;
715 int _currentBucketTime; 715 int _currentBucketTime;
716 num _bucketTimeRange; 716 num _bucketTimeRange;
717 int _sum; 717 int _sum;
718 } 718 }
OLDNEW
« no previous file with comments | « runtime/bin/string_stream.dart ('k') | samples/chat/chat_stress_client.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698