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

Unified Diff: mojo/public/interfaces/bindings/interface_control_messages.mojom

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
« no previous file with comments | « mojo/public/cpp/bindings/tests/interface_ptr_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/interfaces/bindings/interface_control_messages.mojom
diff --git a/mojo/public/interfaces/bindings/interface_control_messages.mojom b/mojo/public/interfaces/bindings/interface_control_messages.mojom
index 42b6297d05157c36a9eee90a3af7ff0f5db7c676..39d7bde9b0b86ed28cac246d8e999e6d64b0ea02 100644
--- a/mojo/public/interfaces/bindings/interface_control_messages.mojom
+++ b/mojo/public/interfaces/bindings/interface_control_messages.mojom
@@ -5,9 +5,8 @@
[JavaPackage="org.chromium.mojo.bindings.interfacecontrol"]
module mojo.interface_control;
-// For each user-defined interface, some control functions are provided at the
-// same end of the message pipe as the user-defined interface, providing
-// information about the user-defined interface.
+// For each user-defined interface, some control functions are provided by the
+// interface endpoints at both sides.
////////////////////////////////////////////////////////////////////////////////
// Run@0xFFFFFFFF(RunInput input) => (RunOutput? output);
@@ -34,12 +33,14 @@ union RunOutput {
};
// Queries the max supported version of the user-defined interface.
+// Sent by the interface client side.
struct QueryVersion {
};
struct QueryVersionResult {
uint32 version;
};
+// Sent by either side of the interface.
struct FlushForTesting {
};
@@ -56,10 +57,20 @@ struct RunOrClosePipeMessageParams {
};
union RunOrClosePipeInput {
RequireVersion require_version;
+ SendDisconnectReason send_disconnect_reason;
};
// If the specified version of the user-defined interface is not supported, the
// function fails and the pipe is closed.
+// Sent by the interface client side.
struct RequireVersion {
uint32 version;
};
+
+// A user-defined reason about why the interface is disconnected. The sender
+// usually send this message and immediately disconnect the interface.
+// Sent by either side of the interface.
+struct SendDisconnectReason {
+ uint32 custom_reason;
+ string description;
+};
« no previous file with comments | « mojo/public/cpp/bindings/tests/interface_ptr_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698