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

Unified Diff: mojo/public/cpp/bindings/lib/control_message_handler.h

Issue 2318793002: Mojo C++ bindings: support disconnect with a reason. (Closed)
Patch Set: . Created 4 years, 3 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/cpp/bindings/lib/control_message_handler.h
diff --git a/mojo/public/cpp/bindings/lib/control_message_handler.h b/mojo/public/cpp/bindings/lib/control_message_handler.h
index 13b5aa6214ea5e08b07cc057e8638ba0f02ad0a1..543218416a0c984edc20b107e0d1bafc3d27d244 100644
--- a/mojo/public/cpp/bindings/lib/control_message_handler.h
+++ b/mojo/public/cpp/bindings/lib/control_message_handler.h
@@ -7,6 +7,8 @@
#include <stdint.h>
+#include <string>
+
#include "base/macros.h"
#include "mojo/public/cpp/bindings/lib/serialization_context.h"
#include "mojo/public/cpp/bindings/message.h"
@@ -28,6 +30,14 @@ class ControlMessageHandler : public MessageReceiverWithResponderStatus {
bool AcceptWithResponder(Message* message,
MessageReceiverWithStatus* responder) override;
+ uint32_t disconnect_custom_reason() const {
+ return disconnect_custom_reason_;
+ }
+
+ const std::string& disconnect_description() const {
+ return disconnect_description_;
+ }
+
private:
bool Run(Message* message, MessageReceiverWithStatus* responder);
bool RunOrClosePipe(Message* message);
@@ -35,6 +45,9 @@ class ControlMessageHandler : public MessageReceiverWithResponderStatus {
uint32_t interface_version_;
SerializationContext context_;
+ uint32_t disconnect_custom_reason_ = 0;
+ std::string disconnect_description_;
+
DISALLOW_COPY_AND_ASSIGN(ControlMessageHandler);
};
« no previous file with comments | « mojo/public/cpp/bindings/lib/binding_state.cc ('k') | mojo/public/cpp/bindings/lib/control_message_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698