Index: mojo/public/js/connection.js |
diff --git a/mojo/public/js/connection.js b/mojo/public/js/connection.js |
index cdf99ce8c3da9107cb3542794ad4bc0e6bbe02aa..2ea7cb72ac1c28ae13d4f065cd29bb5f811bd9c5 100644 |
--- a/mojo/public/js/connection.js |
+++ b/mojo/public/js/connection.js |
@@ -148,6 +148,21 @@ define("mojo/public/js/connection", [ |
return stub; |
} |
+ /** |
+ * Creates a messape pipe and links one end of the pipe to the given object. |
+ * @param {!Object} obj The object to create a handle for. Must be a subclass |
+ * of an auto-generated stub class. |
+ * @return {!MojoHandle} The other (not yet connected) end of the message |
+ * pipe. |
+ */ |
+ function createHandleForImpl(obj) { |
yzshen1
2016/05/27 18:32:46
I like this method!
I feel that createMessagePipe
dpapad
2016/05/27 20:36:56
Done.
As a side note, there is a similar (but not
yzshen1
2016/05/27 20:58:13
Ah, I didn't notice that one! Then in order to mak
dpapad
2016/05/27 21:16:09
No problem. Done.
After looking further into the
|
+ var pipe = core.createMessagePipe(); |
+ var router = new Router(pipe.handle0); |
+ var connection = new BaseConnection(obj, undefined, router); |
+ obj.connection = connection; |
+ return pipe.handle1; |
+ } |
+ |
var exports = {}; |
exports.Connection = Connection; |
exports.TestConnection = TestConnection; |
@@ -156,5 +171,6 @@ define("mojo/public/js/connection", [ |
exports.bindImpl = bindImpl; |
exports.bindHandleToProxy = bindHandleToProxy; |
exports.bindHandleToStub = bindHandleToStub; |
+ exports.createHandleForImpl = createHandleForImpl; |
return exports; |
}); |