Chromium Code Reviews| Index: mojo/apps/js/mojo.js |
| diff --git a/mojo/apps/js/mojo.js b/mojo/apps/js/mojo.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..874405ff9f6fcda4736ac8f136bf643a5d03579b |
| --- /dev/null |
| +++ b/mojo/apps/js/mojo.js |
| @@ -0,0 +1,26 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +define("mojo/apps/js/mojo", [ |
| + "mojo/public/js/bindings/connection", |
| + "mojo_internals", |
| +], function(connection, mojo) { |
| + |
| + function connectToService(url, service, client) { |
| + var serviceHandle = mojo.connectToService(url, service.name); |
| + var clientClass = |
| + (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
|
| + var serviceConnection = |
| + new connection.Connection(serviceHandle, clientClass, service.proxyClass); |
| + serviceConnection.local.delegate$ = client; |
| + serviceConnection.remote.connection$ = serviceConnection; |
| + return serviceConnection.remote; |
| + } |
| + |
| + var exports = {}; |
| + exports.connectToService = connectToService; |
| + exports.quit = mojo.quit; |
| + return exports; |
| +}); |
| + |