From ee05f26cd8c91d14dbda5268b65067b88fe41dde Mon Sep 17 00:00:00 2001 From: Brad Lassey Date: Tue, 9 Jun 2015 09:56:10 -0400 Subject: [PATCH] bug 1161166 - Move some implementation out of ipc headres to not include headres for EndianU32_* r=billm --- ipc/chromium/src/chrome/common/mach_ipc_mac.h | 12 +++--------- ipc/chromium/src/chrome/common/mach_ipc_mac.mm | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/ipc/chromium/src/chrome/common/mach_ipc_mac.h b/ipc/chromium/src/chrome/common/mach_ipc_mac.h index 46466245edb7..de9d8843c3b0 100644 --- a/ipc/chromium/src/chrome/common/mach_ipc_mac.h +++ b/ipc/chromium/src/chrome/common/mach_ipc_mac.h @@ -10,8 +10,6 @@ #include #include -#include - #include "base/basictypes.h" //============================================================================== @@ -145,16 +143,12 @@ class MachMessage { return GetDataLength() > 0 ? GetDataPacket()->data : NULL; } - u_int32_t GetDataLength() { - return EndianU32_LtoN(GetDataPacket()->data_length); - } + u_int32_t GetDataLength(); // The message ID may be used as a code identifying the type of message - void SetMessageID(int32_t message_id) { - GetDataPacket()->id = EndianU32_NtoL(message_id); - } + void SetMessageID(int32_t message_id); - int32_t GetMessageID() { return EndianU32_LtoN(GetDataPacket()->id); } + int32_t GetMessageID(); // Adds a descriptor (typically a mach port) to be translated // returns true if successful, otherwise not enough space diff --git a/ipc/chromium/src/chrome/common/mach_ipc_mac.mm b/ipc/chromium/src/chrome/common/mach_ipc_mac.mm index 3c95ef6dfb2c..8f1250b80408 100644 --- a/ipc/chromium/src/chrome/common/mach_ipc_mac.mm +++ b/ipc/chromium/src/chrome/common/mach_ipc_mac.mm @@ -59,6 +59,21 @@ MachMessage::~MachMessage() { } } + +u_int32_t MachMessage::GetDataLength() { + return EndianU32_LtoN(GetDataPacket()->data_length); +} + + // The message ID may be used as a code identifying the type of message +void MachMessage::SetMessageID(int32_t message_id) { + GetDataPacket()->id = EndianU32_NtoL(message_id); +} + +int32_t MachMessage::GetMessageID() { + return EndianU32_LtoN(GetDataPacket()->id); +} + + //============================================================================== // returns true if successful bool MachMessage::SetData(const void* data,