From 99b15fe4e994592b716ad6345b0195ea779df79b Mon Sep 17 00:00:00 2001 From: Azeem Arshad Date: Thu, 30 May 2019 17:45:36 +0000 Subject: [PATCH] [Mojo Lite] Expose closeBindings method in interfaces. This CL exposes a way to close bindings on an interface so that the client can explicitly disconnect and stop receiving messages. Change-Id: I322f4e41d5522fe8aa7ba9b4a1eb702607281dfe Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1636850 Reviewed-by: Ken Rockot Commit-Queue: Azeem Arshad Cr-Commit-Position: refs/heads/master@{#664795} --- .../js_templates/lite/interface_definition.tmpl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mojo/public/tools/bindings/generators/js_templates/lite/interface_definition.tmpl b/mojo/public/tools/bindings/generators/js_templates/lite/interface_definition.tmpl index 53cce1708a3ed5..094f0dd80e286b 100644 --- a/mojo/public/tools/bindings/generators/js_templates/lite/interface_definition.tmpl +++ b/mojo/public/tools/bindings/generators/js_templates/lite/interface_definition.tmpl @@ -143,6 +143,15 @@ goog.provide('{{module.namespace}}.{{interface.name}}Request'); this.target_.bindHandle(handle); } + /** + * Closes all bindings bound to this target. + * + * @export + */ + closeBindings() { + this.target_.closeBindings(); + } + /** * Returns a proxy for this interface which sends messages to the browser. * The browser must have an interface request binder registered for this