Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 | |
| OLD | NEW |