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

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

Issue 2020463002: Mojo JS: Attempt to simplify bindTo* related code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename Created 4 years, 7 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 | « chrome/test/data/webui/plugins_browsertest.js ('k') | 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 cdf99ce8c3da9107cb3542794ad4bc0e6bbe02aa..3f7e8392b3bb785e3cae8927e7abd261ca80cdd3 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 bindStubDerivedImpl(obj) {
+ 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.bindStubDerivedImpl = bindStubDerivedImpl;
return exports;
});
« no previous file with comments | « chrome/test/data/webui/plugins_browsertest.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698