Skip to content

Commit

Permalink
ipc: Add a new field num_brokered_attachments to the message header o…
Browse files Browse the repository at this point in the history
…n Mac.

This will be used for attachment brokering on Mac.

BUG=535711

Review URL: https://codereview.chromium.org/1373133003

Cr-Commit-Position: refs/heads/master@{#351341}
  • Loading branch information
erikchen authored and Commit bot committed Sep 29, 2015
1 parent 96712c0 commit cd52c88
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ipc/ipc_message.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ Message::~Message() {
Message::Message() : base::Pickle(sizeof(Header)) {
header()->routing = header()->type = 0;
header()->flags = GetRefNumUpper24();
#if defined(OS_MACOSX)
header()->num_brokered_attachments = 0;
#endif
#if defined(OS_POSIX)
header()->num_fds = 0;
header()->pad = 0;
Expand All @@ -62,6 +65,9 @@ Message::Message(int32_t routing_id, uint32_t type, PriorityValue priority)
header()->type = type;
DCHECK((priority & 0xffffff00) == 0);
header()->flags = priority | GetRefNumUpper24();
#if defined(OS_MACOSX)
header()->num_brokered_attachments = 0;
#endif
#if defined(OS_POSIX)
header()->num_fds = 0;
header()->pad = 0;
Expand Down
6 changes: 6 additions & 0 deletions ipc/ipc_message.h
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,12 @@ class IPC_EXPORT Message : public base::Pickle {
int32_t routing; // ID of the view that this message is destined for
uint32_t type; // specifies the user-defined message type
uint32_t flags; // specifies control flags for the message
#if defined(OS_MACOSX)
// The number of brokered attachments included with this message. The
// ids of the brokered attachment ids are sent immediately after the pickled
// message, before the next pickled message is sent.
uint32_t num_brokered_attachments;
#endif
#if defined(OS_POSIX)
uint16_t num_fds; // the number of descriptors included with this message
uint16_t pad; // explicitly initialize this to appease valgrind
Expand Down

0 comments on commit cd52c88

Please sign in to comment.