Index: third_party/mojo/src/mojo/public/tools/bindings/generators/dart_templates/interface_definition.tmpl |
diff --git a/third_party/mojo/src/mojo/public/tools/bindings/generators/dart_templates/interface_definition.tmpl b/third_party/mojo/src/mojo/public/tools/bindings/generators/dart_templates/interface_definition.tmpl |
index cca521d4e48342ca492307f6e20326a9f68f4660..30463b2b6a096c625bf883ae52b29538ece8078f 100644 |
--- a/third_party/mojo/src/mojo/public/tools/bindings/generators/dart_templates/interface_definition.tmpl |
+++ b/third_party/mojo/src/mojo/public/tools/bindings/generators/dart_templates/interface_definition.tmpl |
@@ -63,7 +63,11 @@ class {{interface|name}}ProxyImpl extends bindings.Proxy { |
throw 'Expected a message with a valid request Id.'; |
} |
Completer c = completerMap[message.header.requestId]; |
- completerMap[message.header.requestId] = null; |
+ if (c == null) { |
+ throw 'Message had unknown request Id: ${message.header.requestId}'; |
+ } |
+ completerMap.remove(message.header.requestId); |
+ assert(!c.isCompleted); |
c.complete(r); |
break; |
{%- endif %} |
@@ -154,7 +158,7 @@ class {{interface|name}}Proxy implements bindings.ProxyBase { |
core.MojoMessagePipeEndpoint endpoint) => |
new {{interface|name}}Proxy.fromEndpoint(endpoint); |
- Future close() => impl.close(); |
+ Future close({bool nodefer: false}) => impl.close(nodefer: nodefer); |
String toString() { |
return "{{interface|name}}Proxy($impl)"; |