Chromium Code Reviews| Index: mojo/public/js/connection.js |
| diff --git a/mojo/public/js/connection.js b/mojo/public/js/connection.js |
| index 3f7e8392b3bb785e3cae8927e7abd261ca80cdd3..75104f7f167cc7bcaa6e373e65707b145d2aef25 100644 |
| --- a/mojo/public/js/connection.js |
| +++ b/mojo/public/js/connection.js |
| @@ -98,6 +98,25 @@ define("mojo/public/js/connection", [ |
| return messagePipe.handle1; |
| } |
| + // Return a handle and a proxy for a message pipe that's connected to a proxy |
| + // for |remoteInterface|. Used by generated code for outgoing interface& |
| + // (request) parameters. |
| + function bindProxy2(remoteInterface) { |
|
scheib
2016/09/23 20:53:52
Let's separate out this change to be stand-alone.
|
| + var messagePipe = core.createMessagePipe(); |
| + if (messagePipe.result != core.RESULT_OK) |
| + throw new Error("createMessagePipe failed " + messagePipe.result); |
| + |
| + var proxy = new remoteInterface.proxyClass; |
| + var router = new Router(messagePipe.handle0); |
| + var connection = new BaseConnection(undefined, proxy, router); |
| + ProxyBindings(proxy).connection = connection; |
| + |
| + return { |
| + handle: messagePipe.handle1, |
| + proxy: proxy |
| + }; |
| + } |
| + |
| // Return a handle for a message pipe that's connected to a stub for |
| // localInterface. Used by generated code for outgoing interface |
| // parameters: the caller is given the generated stub via |
| @@ -168,6 +187,7 @@ define("mojo/public/js/connection", [ |
| exports.TestConnection = TestConnection; |
| exports.bindProxy = bindProxy; |
| + exports.bindProxy2 = bindProxy2; |
| exports.bindImpl = bindImpl; |
| exports.bindHandleToProxy = bindHandleToProxy; |
| exports.bindHandleToStub = bindHandleToStub; |