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

Unified Diff: mojo/edk/system/broker_messages.h

Issue 1555273002: [mojo] Add CreateSharedBuffer method to Broker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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/edk/system/broker_messages.h
diff --git a/mojo/edk/system/broker_messages.h b/mojo/edk/system/broker_messages.h
index 0ce0960d685b9fadc8e0cb5c1c0c7adf936bfd2c..f7616c13d0782b118e8cb1a2662878514f954a6c 100644
--- a/mojo/edk/system/broker_messages.h
+++ b/mojo/edk/system/broker_messages.h
@@ -29,21 +29,37 @@ enum WindowsSandboxMessages {
TOKEN_TO_HANDLE,
};
+#else
+// Sandbox processes need the parent's help to create shared buffers.
+enum PosixSandboxMessages {
+ // The reply is a PlatformHandle.
+ CREATE_SHARED_BUFFER = 0
+};
+#endif
+
// Definitions of the raw bytes sent in messages.
struct BrokerMessage {
uint32_t size;
+#if defined(OS_WIN)
WindowsSandboxMessages id;
// Data, if any, follows.
union {
HANDLE handles[1]; // If HANDLE_TO_TOKEN.
uint64_t tokens[1]; // If TOKEN_TO_HANDLE.
};
-};
+#else
+ PosixSandboxMessages id;
-const int kBrokerMessageHeaderSize =
- sizeof(uint32_t) + sizeof(WindowsSandboxMessages);
+ uint32_t num_bytes; // Size of the shared buffer to create.
+#endif
+};
+const int kBrokerMessageHeaderSize = sizeof(uint32_t) +
+#if defined(OS_WIN)
+ sizeof(WindowsSandboxMessages);
+#else
+ sizeof(PosixSandboxMessages);
#endif
// Route id used for messages between ChildBroker and ChildBrokerHost.

Powered by Google App Engine
This is Rietveld 408576698