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

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

Issue 1394303004: Move //mojo/services/X/public/... to //mojo/services/X/... (part 3). (Closed) Base URL: https://github.com/domokit/mojo.git@no_public_2-x-no_public_1
Patch Set: 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/ganesh_app/texture_uploader.cc ('k') | examples/keyboard_client/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 2015 The Chromium Authors. All rights reserved. 2 // Copyright 2015 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 // Simple JavaScript REPL example, using TerminalClient. 6 // Simple JavaScript REPL example, using TerminalClient.
7 // 7 //
8 // To run this, do something like: 8 // To run this, do something like:
9 // 9 //
10 // $ sky/tools/mojodb start out/Debug mojo:moterm_example_app 10 // $ sky/tools/mojodb start out/Debug mojo:moterm_example_app
(...skipping 10 matching lines...) Expand all
21 // undefined 21 // undefined
22 // > f("abc", 123) 22 // > f("abc", 123)
23 // "abc123" 23 // "abc123"
24 // 24 //
25 // (Note that multiple simultaneous REPLs will share the same global state, that 25 // (Note that multiple simultaneous REPLs will share the same global state, that
26 // the global state will persist, etc. This is really just intended as a demo!) 26 // the global state will persist, etc. This is really just intended as a demo!)
27 27
28 define("main", [ 28 define("main", [
29 "mojo/services/public/js/application", 29 "mojo/services/public/js/application",
30 "mojo/services/files/interfaces/types.mojom", 30 "mojo/services/files/interfaces/types.mojom",
31 "mojo/services/terminal/public/interfaces/terminal_client.mojom", 31 "mojo/services/terminal/interfaces/terminal_client.mojom",
32 ], function(application, files_types, terminal_client) { 32 ], function(application, files_types, terminal_client) {
33 const Application = application.Application; 33 const Application = application.Application;
34 const TerminalClient = terminal_client.TerminalClient; 34 const TerminalClient = terminal_client.TerminalClient;
35 const Whence = files_types.Whence; 35 const Whence = files_types.Whence;
36 36
37 function stringToBytes(s) { 37 function stringToBytes(s) {
38 return s.split("").map(function (c) { return c.charCodeAt(0); }); 38 return s.split("").map(function (c) { return c.charCodeAt(0); });
39 } 39 }
40 40
41 class Repl { 41 class Repl {
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 101
102 class ReplApp extends Application { 102 class ReplApp extends Application {
103 acceptConnection(initiatorURL, initiatorServiceExchange) { 103 acceptConnection(initiatorURL, initiatorServiceExchange) {
104 initiatorServiceExchange.provideService(TerminalClient, 104 initiatorServiceExchange.provideService(TerminalClient,
105 TerminalClientImpl); 105 TerminalClientImpl);
106 } 106 }
107 } 107 }
108 108
109 return ReplApp; 109 return ReplApp;
110 }); 110 });
OLDNEW
« no previous file with comments | « examples/ganesh_app/texture_uploader.cc ('k') | examples/keyboard_client/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698