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

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

Issue 1890043002: [mojo-edk] Support transferring null Mach ports. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/channel.h
diff --git a/mojo/edk/system/channel.h b/mojo/edk/system/channel.h
index 9932c9c71fc0d1695dab89bc6d40491adb70a0a4..1d384a978b631b6bd61e44345f5d26c44f14b7e6 100644
--- a/mojo/edk/system/channel.h
+++ b/mojo/edk/system/channel.h
@@ -76,6 +76,13 @@ class Channel : public base::RefCountedThreadSafe<Channel> {
};
static_assert(sizeof(MachPortsEntry) == 6,
"sizeof(MachPortsEntry) must be 6 bytes");
+
+ struct MachPortsExtraHeader {
+ uint16_t num_ports;
+ MachPortsEntry entries[0];
+ };
+ static_assert(sizeof(MachPortsExtraHeader) == 2,
+ "sizeof(MachPortsExtraHeader) must be 2 bytes");
#endif
#pragma pack(pop)
@@ -155,7 +162,7 @@ class Channel : public base::RefCountedThreadSafe<Channel> {
#if defined(OS_MACOSX) && !defined(OS_IOS)
// On OSX, handles are serialised into the extra header section.
- MachPortsEntry* mach_ports_ = nullptr;
+ MachPortsExtraHeader* mach_ports_header_ = nullptr;
#endif
DISALLOW_COPY_AND_ASSIGN(Message);

Powered by Google App Engine
This is Rietveld 408576698