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

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: 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
« chrome/browser/resources/plugins.js ('K') | « chrome/browser/resources/plugins.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..34bdfb09a6610eec535f74fc2b283eb053fc1fde 100644
--- a/mojo/public/js/connection.js
+++ b/mojo/public/js/connection.js
@@ -148,6 +148,15 @@ define("mojo/public/js/connection", [
return stub;
}
+ function bindHandleToObj(handle, obj) {
yzshen1 2016/05/27 16:24:45 Please add comments.
+ if (!core.isHandle(handle))
+ throw new Error("Not a handle " + handle);
+
+ var router = new Router(handle);
+ var connection = new BaseConnection(obj, undefined, router);
+ obj.connection = connection;
+ }
+
var exports = {};
exports.Connection = Connection;
exports.TestConnection = TestConnection;
@@ -156,5 +165,6 @@ define("mojo/public/js/connection", [
exports.bindImpl = bindImpl;
exports.bindHandleToProxy = bindHandleToProxy;
exports.bindHandleToStub = bindHandleToStub;
+ exports.bindHandleToObj = bindHandleToObj;
return exports;
});
« chrome/browser/resources/plugins.js ('K') | « chrome/browser/resources/plugins.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698