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..e13350a9b39f49587a9b2f6ab15c38648995ed09 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 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) { |
|
Ken Rockot(use gerrit already)
2016/10/04 22:36:51
Let's call this getProxy. We'll probably change it
mbrunson
2016/10/04 22:55:08
Done.
|
| + 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, |
|
Ken Rockot(use gerrit already)
2016/10/04 22:36:51
nit: Let's call this requestHandle
mbrunson
2016/10/04 22:55:08
Done.
|
| + 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; |