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

Side by Side Diff: services/js/test/echo.js

Issue 767323002: Mojo JS Bindings: restore the ServiceProvider class, add an application test (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Removed console import from ServiceProvider 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 | « services/js/test/BUILD.gn ('k') | services/js/test/echo_service.mojom » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!mojo:js_content_handler
2
3 define("main", [
4 "console",
5 "mojo/services/public/js/service-provider",
6 "services/js/test/echo_service.mojom",
7 "services/js/app-bridge",
8 ], function(console, spModule, echoModule, appModule) {
9
10 function Application(shell, url) {
11 this.shell = shell;
12 this.serviceProviders = [];
13 }
14
15 Application.prototype.initialize = function(args) {
16 }
17
18 Application.prototype.acceptConnection = function(url, spHandle) {
19 function EchoServiceImpl(client) {
20 this.echoString = function(s) {
21 if (s == "quit")
22 appModule.quit();
23 return Promise.resolve({value: s});
24 };
25 }
26 var serviceProvider = new spModule.ServiceProvider(spHandle);
27 serviceProvider.provideService(echoModule.EchoService, EchoServiceImpl);
28 this.serviceProviders.push(serviceProvider);
29 }
30
31 return Application;
32 });
OLDNEW
« no previous file with comments | « services/js/test/BUILD.gn ('k') | services/js/test/echo_service.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698