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

Side by Side Diff: examples/dart/wget/main.dart

Issue 953953003: Introduce dartanalyze into our build. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Only run dartanalyze on the toplevel check target. Created 5 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
« no previous file with comments | « BUILD.gn ('k') | mojo/public/dart/rules.gni » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Run with, e.g.: 5 // Run with, e.g.:
6 // mojo_shell "mojo:dart_wget http://www.google.com" 6 // mojo_shell "mojo:dart_wget http://www.google.com"
7 7
8 import 'dart:async'; 8 import 'dart:async';
9 import 'dart:mojo_application'; 9 import 'dart:mojo_application';
10 import 'dart:mojo_bindings'; 10 import 'dart:mojo_bindings';
(...skipping 20 matching lines...) Expand all
31 31
32 ByteData bodyData = await _getUrl(args[1]); 32 ByteData bodyData = await _getUrl(args[1]);
33 print(">>> Body <<<"); 33 print(">>> Body <<<");
34 print(new String.fromCharCodes(bodyData.buffer.asUint8List())); 34 print(new String.fromCharCodes(bodyData.buffer.asUint8List()));
35 print(">>> EOF <<<"); 35 print(">>> EOF <<<");
36 36
37 _closeProxies(); 37 _closeProxies();
38 close(); 38 close();
39 } 39 }
40 40
41
Cutch 2015/02/25 19:33:44 unnecessary white space?
Elliot Glaysher 2015/02/25 20:19:17 Done.
41 Future<ByteData> _getUrl(String url) async { 42 Future<ByteData> _getUrl(String url) async {
42 _initProxiesIfNeeded(); 43 _initProxiesIfNeeded();
43 44
44 var urlRequest = new UrlRequest() 45 var urlRequest = new UrlRequest()
45 ..url = url 46 ..url = url
46 ..autoFollowRedirects = true; 47 ..autoFollowRedirects = true;
47 48
48 var urlResponse = await _urlLoaderProxy.start(urlRequest); 49 var urlResponse = await _urlLoaderProxy.start(urlRequest);
49 print(">>> Headers <<<"); 50 print(">>> Headers <<<");
50 print(urlResponse.response.headers.join('\n')); 51 print(urlResponse.response.headers.join('\n'));
(...skipping 18 matching lines...) Expand all
69 _urlLoaderProxy = null; 70 _urlLoaderProxy = null;
70 _networkService = null; 71 _networkService = null;
71 } 72 }
72 } 73 }
73 74
74 main(List args) { 75 main(List args) {
75 MojoHandle appHandle = new MojoHandle(args[0]); 76 MojoHandle appHandle = new MojoHandle(args[0]);
76 var wget = new WGet.fromHandle(appHandle); 77 var wget = new WGet.fromHandle(appHandle);
77 wget.listen(); 78 wget.listen();
78 } 79 }
OLDNEW
« no previous file with comments | « BUILD.gn ('k') | mojo/public/dart/rules.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698