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

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: 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
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_internals",
8 ], function(connection, mojo) {
9
10 function connectToService(url, service, client) {
11 var serviceHandle = mojo.connectToService(url, service.name);
12 var clientClass =
13 (client && service.client.delegatingStubClass) || function(){};
abarth-chromium 2014/10/10 17:45:07 var clientClass = client && service.client.delegat
hansmuller 2014/10/10 20:53:48 The clientClass becomes the Connection's localFact
14 var serviceConnection =
15 new connection.Connection(serviceHandle, clientClass, service.proxyClass);
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

Powered by Google App Engine
This is Rietveld 408576698