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

Unified Diff: mojo/public/js/connection.js

Issue 2389303002: Add bindProxy implementation without callback. (Closed)
Patch Set: Renaming Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/js/connection.js
diff --git a/mojo/public/js/connection.js b/mojo/public/js/connection.js
index 3f7e8392b3bb785e3cae8927e7abd261ca80cdd3..1ac88ed9e6354e8db83a37b7ec350bd947e0c445 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 getProxy(remoteInterface) {
+ 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 {
+ requestHandle: 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.getProxy = getProxy;
exports.bindImpl = bindImpl;
exports.bindHandleToProxy = bindHandleToProxy;
exports.bindHandleToStub = bindHandleToStub;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698