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

Side by Side Diff: examples/js/wget.js

Issue 1404443004: Move //mojo/services/network/public/interfaces to //mojo/services/network/interfaces. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: add some missing dependencies Created 5 years, 2 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 | « examples/js/users-guide.md ('k') | examples/pdf_viewer/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!mojo mojo:js_content_handler 1 #!mojo mojo:js_content_handler
2 // Copyright 2014 The Chromium Authors. All rights reserved. 2 // Copyright 2014 The Chromium Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be 3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file. 4 // found in the LICENSE file.
5 5
6 // Demonstrate use of the Mojo network service to load a URL. To run this 6 // Demonstrate use of the Mojo network service to load a URL. To run this
7 // application with mojo_shell, set DIR to be the absolute path for this 7 // application with mojo_shell, set DIR to be the absolute path for this
8 // directory, then: 8 // directory, then:
9 // mojo_shell "file://$DIR/wget.js http://www.google.com" 9 // mojo_shell "file://$DIR/wget.js http://www.google.com"
10 // Substitute any URL for google.com. To keep the noise down, this app 10 // Substitute any URL for google.com. To keep the noise down, this app
11 // only displays the number of bytes read and a little http header info. 11 // only displays the number of bytes read and a little http header info.
12 12
13 define("main", [ 13 define("main", [
14 "console", 14 "console",
15 "mojo/services/public/js/application", 15 "mojo/services/public/js/application",
16 "mojo/public/js/core", 16 "mojo/public/js/core",
17 "mojo/services/network/public/interfaces/network_service.mojom", 17 "mojo/services/network/interfaces/network_service.mojom",
18 "mojo/public/interfaces/network/url_request.mojom", 18 "mojo/public/interfaces/network/url_request.mojom",
19 ], function(console, application, core, network, request) { 19 ], function(console, application, core, network, request) {
20 20
21 const Application = application.Application; 21 const Application = application.Application;
22 const NetworkService = network.NetworkService; 22 const NetworkService = network.NetworkService;
23 const URLRequest = request.URLRequest; 23 const URLRequest = request.URLRequest;
24 24
25 class WGet extends Application { 25 class WGet extends Application {
26 initialize(args) { 26 initialize(args) {
27 if (args.length != 2) { 27 if (args.length != 2) {
(...skipping 29 matching lines...) Expand all
57 app.quit(); 57 app.quit();
58 }); 58 });
59 }).catch(function(e) { 59 }).catch(function(e) {
60 console.log("URLLoader start() failed: " + e.stack); 60 console.log("URLLoader start() failed: " + e.stack);
61 }); 61 });
62 } 62 }
63 } 63 }
64 64
65 return WGet; 65 return WGet;
66 }); 66 });
OLDNEW
« no previous file with comments | « examples/js/users-guide.md ('k') | examples/pdf_viewer/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698