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

Unified Diff: mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl

Issue 696373003: Don't GC message pipes that have an in-flight request (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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/bindings/router.js ('k') | sky/examples/file-browser.sky » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl
diff --git a/mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl b/mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl
index 1212dae59ffc259a6a61a9bcb34ef14514cf56ec..27c7cf353cf4e068219bf01236ca3b0c9361bf55 100644
--- a/mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl
+++ b/mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl
@@ -32,17 +32,14 @@
codec.kMessageExpectsResponse, 0);
builder.encodeStruct({{interface.name}}_{{method.name}}_Params, params);
var message = builder.finish();
- this.receiver_.acceptWithResponder(message, {
- accept: function(message) {
- var reader = new codec.MessageReader(message);
- var responseParams =
- reader.decodeStruct({{interface.name}}_{{method.name}}_ResponseParams);
- resolve(responseParams);
- },
- reject: function(result) {
- reject(Error("Connection error: " + result));
- },
- }).catch(reject);
+ this.receiver_.acceptAndExpectResponse(message).then(function(message) {
+ var reader = new codec.MessageReader(message);
+ var responseParams =
+ reader.decodeStruct({{interface.name}}_{{method.name}}_ResponseParams);
+ resolve(responseParams);
+ }).catch(function(result) {
+ reject(Error("Connection error: " + result));
+ });
}.bind(this));
{%- endif %}
};
« no previous file with comments | « mojo/public/js/bindings/router.js ('k') | sky/examples/file-browser.sky » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698