Chromium Code Reviews| 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; |
| }); |