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 %} |
}; |