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

Unified Diff: third_party/mojo/src/mojo/public/js/bindings.js

Issue 883843002: Update mojo sdk to rev 126532ce21c5c3c55a1e1693731411cb60169efd (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Response to review Created 5 years, 11 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
Index: third_party/mojo/src/mojo/public/js/bindings.js
diff --git a/third_party/mojo/src/mojo/public/js/bindings.js b/third_party/mojo/src/mojo/public/js/bindings.js
index 5f8586048ee4d357594dd84764c265de010d14d0..44aa9f4e9fed6529dbfa495db9712c939e01d38e 100644
--- a/third_party/mojo/src/mojo/public/js/bindings.js
+++ b/third_party/mojo/src/mojo/public/js/bindings.js
@@ -4,7 +4,8 @@
define("mojo/public/js/bindings", [
"mojo/public/js/router",
-], function(router) {
+ "mojo/public/js/core",
+], function(router, core) {
var Router = router.Router;
@@ -17,10 +18,12 @@ define("mojo/public/js/bindings", [
this.receiver = receiver;
}
+ // TODO(hansmuller): remove then after 'Client=' has been removed from Mojom.
ProxyProperties.prototype.getLocalDelegate = function() {
return this.local && StubBindings(this.local).delegate;
}
+ // TODO(hansmuller): remove then after 'Client=' has been removed from Mojom.
ProxyProperties.prototype.setLocalDelegate = function(impl) {
if (this.local)
StubBindings(this.local).delegate = impl;
@@ -28,12 +31,31 @@ define("mojo/public/js/bindings", [
throw new Error("no stub object");
}
+ function connectionHandle(connection) {
+ return connection &&
+ connection.router &&
+ connection.router.connector_ &&
+ connection.router.connector_.handle_;
+ }
+
+ ProxyProperties.prototype.close = function() {
+ var handle = connectionHandle(this.connection);
+ if (handle)
+ core.close(handle);
+ }
+
// Public stub class properties that are managed at runtime by the JS
// bindings. See StubBindings below.
function StubProperties(delegate) {
this.delegate = delegate;
}
+ StubProperties.prototype.close = function() {
+ var handle = connectionHandle(this.connection);
+ if (handle)
+ core.close(handle);
+ }
+
// The base class for generated proxy classes.
function ProxyBase(receiver) {
this[kProxyProperties] = new ProxyProperties(receiver);
@@ -48,6 +70,9 @@ define("mojo/public/js/bindings", [
this[kStubProperties] = new StubProperties(delegate);
}
+ // TODO(hansmuller): remove everything except the connection property doc
+ // after 'Client=' has been removed from Mojom.
+
// Provides access to properties added to a proxy object without risking
// Mojo interface name collisions. Unless otherwise specified, the initial
// value of all properties is undefined.
@@ -71,6 +96,9 @@ define("mojo/public/js/bindings", [
return (proxy instanceof ProxyBase) ? proxy[kProxyProperties] : proxy;
}
+ // TODO(hansmuller): remove the remote doc after 'Client=' has been
+ // removed from Mojom.
+
// Provides access to properties added to a stub object without risking
// Mojo interface name collisions. Unless otherwise specified, the initial
// value of all properties is undefined.

Powered by Google App Engine
This is Rietveld 408576698