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

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

Issue 799113004: Update mojo sdk to rev 59145288bae55b0fce4276b017df6a1117bcf00f (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add mojo's ply to checklicenses whitelist Created 6 years 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 | « mojo/public/js/codec.js ('k') | mojo/public/js/struct_unittests.js » ('j') | 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 748ca5c30b05980d22e6eacbdc73df0061fd725b..eef89f6a511f070de7c1c23c8e8d9e8fa4d16b43 100644
--- a/mojo/public/js/connection.js
+++ b/mojo/public/js/connection.js
@@ -8,6 +8,9 @@ define("mojo/public/js/connection", [
"mojo/public/js/router",
], function(connector, core, routerModule) {
+ // TODO(hansmuller): the proxy connection_ property should connection$
+ // TODO(hansmuller): the proxy receiver_ property should be receiver$
+
function BaseConnection(localStub, remoteProxy, router) {
this.router_ = router;
this.local = localStub;
@@ -88,11 +91,36 @@ define("mojo/public/js/connection", [
return stub.connection_;
}
+ function initProxyInstance(proxy, proxyInterface, receiver) {
+ if (proxyInterface.client) {
+ Object.defineProperty(proxy, 'client$', {
+ get: function() {
+ var connection = getProxyConnection(proxy, proxyInterface);
+ return connection.local && connection.local.delegate$
+ },
+ set: function(value) {
+ var connection = getProxyConnection(proxy, proxyInterface);
+ if (connection.local)
+ connection.local.delegate$ = value;
+ }
+ });
+ }
+ if (receiver instanceof routerModule.Router) {
+ // TODO(hansmuller): Temporary, for Chrome backwards compatibility.
+ proxy.receiver_ = receiver;
+ } else if (receiver) {
+ var router = new routerModule.Router(receiver);
+ var stub = proxyInterface.client && new proxyInterface.client.stubClass;
+ proxy.connection_ = new BaseConnection(stub, proxy, router);
+ proxy.connection_.messagePipeHandle = receiver;
+ }
+ }
var exports = {};
exports.Connection = Connection;
exports.TestConnection = TestConnection;
exports.getProxyConnection = getProxyConnection;
exports.getStubConnection = getStubConnection;
+ exports.initProxyInstance = initProxyInstance;
return exports;
});
« no previous file with comments | « mojo/public/js/codec.js ('k') | mojo/public/js/struct_unittests.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698