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

Side by Side Diff: editor/tools/plugins/com.google.dart.tools.core_test/src-dart/pub_package_server.dart

Issue 48483002: Remove deprecated parts of dart:async. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comment. Created 7 years, 1 month 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 | « no previous file | pkg/barback/lib/src/asset_cascade.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 /// Runs a HTTP server on localhost that mimics the behavoir of pub.dartlang.org 5 /// Runs a HTTP server on localhost that mimics the behavoir of pub.dartlang.org
6 /// and serves files on pub requests. Files to be stored are on disk in the file 6 /// and serves files on pub requests. Files to be stored are on disk in the file
7 /// system. 7 /// system.
8 /// 8 ///
9 /// The port for the server and the base directory of the data to be served 9 /// The port for the server and the base directory of the data to be served
10 /// should be passed in as arguments 10 /// should be passed in as arguments
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 file = new File('$baseDir$path.txt'); 50 file = new File('$baseDir$path.txt');
51 } else { 51 } else {
52 file = new File('$baseDir$path'); 52 file = new File('$baseDir$path');
53 } 53 }
54 54
55 file.readAsBytes().then((data) { 55 file.readAsBytes().then((data) {
56 response.statusCode = 200; 56 response.statusCode = 200;
57 response.contentLength = data.length; 57 response.contentLength = data.length;
58 response.add(data); 58 response.add(data);
59 response.close(); 59 response.close();
60 }).catchError((e) { 60 }).catchError((e, trace) {
61 print(getAttachedStackTrace(e)); 61 print(trace);
62 response.statusCode = 404; 62 response.statusCode = 404;
63 response.contentLength = 0; 63 response.contentLength = 0;
64 response.close(); 64 response.close();
65 }); 65 });
66 } catch (e) { 66 } catch (e) {
67 print(e); 67 print(e);
68 response.statusCode = 500; 68 response.statusCode = 500;
69 response.close(); 69 response.close();
70 return; 70 return;
71 } 71 }
72 } 72 }
73 73
OLDNEW
« no previous file with comments | « no previous file | pkg/barback/lib/src/asset_cascade.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698