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

Side by Side Diff: mojo/apps/js/main.js

Issue 708563002: Move mojo/public/js/bindings/ moves to mojo/public/js/ (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Sync again Created 6 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
« no previous file with comments | « mojo/apps/js/bindings/connection_unittests.js ('k') | mojo/apps/js/mojo.js » ('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 // This trivial app just loads "cnn.com" using the Mojo Network and URLLoader 5 // This trivial app just loads "cnn.com" using the Mojo Network and URLLoader
6 // services and then prints a brief summary of the response. 6 // services and then prints a brief summary of the response.
7 // 7 //
8 // To run it this file must be specified as a URL. For 8 // To run it this file must be specified as a URL. For
9 // example: 9 // example:
10 // (cd YOUR_DIR/mojo/apps/js; python -m SimpleHTTPServer ) & 10 // (cd YOUR_DIR/mojo/apps/js; python -m SimpleHTTPServer ) &
11 // mojo_shell \ 11 // mojo_shell \
12 // --content-handlers=application/javascript,mojo://js_content_handler \ 12 // --content-handlers=application/javascript,mojo://js_content_handler \
13 // http://localhost:8000/test.js 13 // http://localhost:8000/test.js
14 14
15 define("test", [ 15 define("test", [
16 "mojo/apps/js/mojo", 16 "mojo/apps/js/mojo",
17 "mojo/public/js/bindings/core", 17 "mojo/public/js/core",
18 "mojo/public/js/bindings/connection", 18 "mojo/public/js/connection",
19 "mojo/public/js/bindings/support", 19 "mojo/public/js/support",
20 "mojo/services/public/interfaces/network/network_service.mojom", 20 "mojo/services/public/interfaces/network/network_service.mojom",
21 "mojo/services/public/interfaces/network/url_loader.mojom", 21 "mojo/services/public/interfaces/network/url_loader.mojom",
22 "console" 22 "console"
23 ], function(mojo, core, connection, support, net, loader, console) { 23 ], function(mojo, core, connection, support, net, loader, console) {
24 24
25 var networkService = mojo.shell().connectToService( 25 var networkService = mojo.shell().connectToService(
26 "mojo:network_service", net.NetworkService); 26 "mojo:network_service", net.NetworkService);
27 27
28 var urlLoaderPipe = core.createMessagePipe(); 28 var urlLoaderPipe = core.createMessagePipe();
29 networkService.createURLLoader(urlLoaderPipe.handle1); 29 networkService.createURLLoader(urlLoaderPipe.handle1);
(...skipping 13 matching lines...) Expand all
43 for(var key in result.response) 43 for(var key in result.response)
44 console.log(key + " => " + result.response[key]); 44 console.log(key + " => " + result.response[key]);
45 var drainDataPromise = core.drainData(result.response.body); 45 var drainDataPromise = core.drainData(result.response.body);
46 drainDataPromise.then(function(result) { 46 drainDataPromise.then(function(result) {
47 console.log("read " + result.buffer.byteLength + " bytes"); 47 console.log("read " + result.buffer.byteLength + " bytes");
48 }).then(function() { 48 }).then(function() {
49 mojo.quit(); 49 mojo.quit();
50 }); 50 });
51 }); 51 });
52 }); 52 });
OLDNEW
« no previous file with comments | « mojo/apps/js/bindings/connection_unittests.js ('k') | mojo/apps/js/mojo.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698