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

Unified Diff: mojo/public/tools/bindings/generators/cpp_templates/interface_stub_declaration.tmpl

Issue 1003773002: CPP bindings: DCHECK when a Callback is destructed without being invoked (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Adds close() notification to Stub when Binding is closed or deleted. Created 5 years, 9 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: mojo/public/tools/bindings/generators/cpp_templates/interface_stub_declaration.tmpl
diff --git a/mojo/public/tools/bindings/generators/cpp_templates/interface_stub_declaration.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/interface_stub_declaration.tmpl
index afc6504dc81f33bf535546964eafcd06a29d266b..d9bbd75e5081cf76db35b3136a0dd7eea0bfd609 100644
--- a/mojo/public/tools/bindings/generators/cpp_templates/interface_stub_declaration.tmpl
+++ b/mojo/public/tools/bindings/generators/cpp_templates/interface_stub_declaration.tmpl
@@ -8,6 +8,25 @@ class {{interface.name}}Stub : public mojo::MessageReceiverWithResponder {
virtual bool AcceptWithResponder(mojo::Message* message,
mojo::MessageReceiver* responder) override;
+ void OnConnectionError() {
+ connection_error_occurred_ = true;
+ }
+
+ bool connection_error_occurred() const {
+ return connection_error_occurred_;
+ }
+
+ void Close() {
+ closed_ = true;
+ }
+
+ bool closed() {
+ return closed_;
+ }
+
+
private:
{{interface.name}}* sink_;
+ bool connection_error_occurred_;
+ bool closed_;
};

Powered by Google App Engine
This is Rietveld 408576698