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

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

Issue 789243002: Restructure public side of network service. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Rebase Created 6 years 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/README.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:js_content_handler 1 #!mojo:js_content_handler
2 // Demonstrate use of the Mojo network service to load a URL. To run this 2 // Demonstrate use of the Mojo network service to load a URL. To run this
3 // application with mojo_shell, set DIR to be the absolute path for this 3 // application with mojo_shell, set DIR to be the absolute path for this
4 // directory, then: 4 // directory, then:
5 // mojo_shell "file://$DIR/wget.js http://www.google.com" 5 // mojo_shell "file://$DIR/wget.js http://www.google.com"
6 // Substitute any URL for google.com. To keep the noise down, this app 6 // Substitute any URL for google.com. To keep the noise down, this app
7 // only displays the number of bytes read and a little http header info. 7 // only displays the number of bytes read and a little http header info.
8 8
9 define("main", [ 9 define("main", [
10 "console", 10 "console",
11 "mojo/public/js/core", 11 "mojo/public/js/core",
12 "mojo/services/public/interfaces/network/network_service.mojom", 12 "mojo/services/network/public/interfaces/network_service.mojom",
13 "mojo/services/public/interfaces/network/url_loader.mojom", 13 "mojo/services/network/public/interfaces/url_loader.mojom",
14 "mojo/services/public/js/application", 14 "mojo/services/public/js/application",
15 ], function(console, coreModule, netModule, loaderModule, appModule) { 15 ], function(console, coreModule, netModule, loaderModule, appModule) {
16 16
17 class WGet extends appModule.Application { 17 class WGet extends appModule.Application {
18 initialize(args) { 18 initialize(args) {
19 if (args.length != 2) { 19 if (args.length != 2) {
20 console.log("Expected URL argument"); 20 console.log("Expected URL argument");
21 return; 21 return;
22 } 22 }
23 23
(...skipping 21 matching lines...) Expand all
45 }) 45 })
46 .then(function() { 46 .then(function() {
47 app.quit(); 47 app.quit();
48 }); 48 });
49 }); 49 });
50 } 50 }
51 } 51 }
52 52
53 return WGet; 53 return WGet;
54 }); 54 });
OLDNEW
« no previous file with comments | « examples/js/README.md ('k') | examples/pdf_viewer/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698