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

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

Issue 637373002: Mojo JS bindings: simplify mojo.connectToService() usage - Part 2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Renamed the mojo_internals module, made Connection localFactory optional 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 unified diff | Download patch
« no previous file with comments | « mojo/apps/js/main.js ('k') | mojo/apps/js/mojo_bridge_module.h » ('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 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 define("mojo/apps/js/mojo", [
6 "mojo/public/js/bindings/connection",
7 "mojo/apps/js/bridge",
8 ], function(connection, mojo) {
9
10 function connectToService(url, service, client) {
11 var serviceHandle = mojo.connectToService(url, service.name);
12 var clientClass = client && service.client.delegatingStubClass;
13 var serviceConnection =
14 new connection.Connection(serviceHandle, clientClass, service.proxyClass);
15 if (serviceConnection.local)
16 serviceConnection.local.delegate$ = client;
17 serviceConnection.remote.connection$ = serviceConnection;
18 return serviceConnection.remote;
19 }
20
21 var exports = {};
22 exports.connectToService = connectToService;
23 exports.quit = mojo.quit;
24 return exports;
25 });
26
OLDNEW
« no previous file with comments | « mojo/apps/js/main.js ('k') | mojo/apps/js/mojo_bridge_module.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698