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

Unified Diff: mojo/apps/js/main.js

Issue 646943006: Remove mojo/apps/js, it is unused (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/apps/js/js_app.cc ('k') | mojo/apps/js/mojo.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/apps/js/main.js
diff --git a/mojo/apps/js/main.js b/mojo/apps/js/main.js
deleted file mode 100644
index f8be85c3f77cf85c9564b63b42a05f04a40ab1fe..0000000000000000000000000000000000000000
--- a/mojo/apps/js/main.js
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// This trivial app just loads "cnn.com" using the Mojo Network and URLLoader
-// services and then prints a brief summary of the response.
-//
-// To run it using mojo_js_standalone (don't forget the quotes):
-// mojo_shell 'mojo://js_standalone THIS_DIR/main.js'
-//
-// To run it using mojo_js_content handler this file must be specified as
-// a URL. For example:
-// (cd YOUR_DIR/mojo/apps/js; python -m SimpleHTTPServer ) &
-// mojo_shell \
-// --content-handlers=application/javascript,mojo://js_content_handler \
-// http://localhost:8000/test.js
-
-define("test", [
- "mojo/apps/js/mojo",
- "mojo/public/js/bindings/core",
- "mojo/public/js/bindings/connection",
- "mojo/public/js/bindings/support",
- "mojo/services/public/interfaces/network/network_service.mojom",
- "mojo/services/public/interfaces/network/url_loader.mojom",
- "console"
-], function(mojo, core, connection, support, net, loader, console) {
-
- var networkService = mojo.connectToService(
- "mojo:network_service", net.NetworkService);
-
- var urlLoaderPipe = core.createMessagePipe();
- networkService.createURLLoader(urlLoaderPipe.handle1);
- var urlLoaderConnection = new connection.Connection(
- urlLoaderPipe.handle0,
- function(){},
- loader.URLLoader.proxyClass);
-
- var urlRequest = new loader.URLRequest({
- url: "http://www.cnn.com",
- method: "GET",
- auto_follow_redirects: true
- });
-
- var urlRequestPromise = urlLoaderConnection.remote.start(urlRequest);
- urlRequestPromise.then(function(result) {
- for(var key in result.response)
- console.log(key + " => " + result.response[key]);
- var drainDataPromise = core.drainData(result.response.body);
- drainDataPromise.then(function(result) {
- console.log("read " + result.buffer.byteLength + " bytes");
- }).then(function() {
- mojo.quit();
- });
- });
-});
« no previous file with comments | « mojo/apps/js/js_app.cc ('k') | mojo/apps/js/mojo.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698