diff options
Diffstat (limited to 'ipc')
-rw-r--r-- | ipc/ipc_channel_posix.cc | 4 | ||||
-rw-r--r-- | ipc/ipc_logging.cc | 4 | ||||
-rw-r--r-- | ipc/ipc_logging.h | 4 | ||||
-rw-r--r-- | ipc/ipc_message.cc | 4 | ||||
-rw-r--r-- | ipc/ipc_message.h | 16 | ||||
-rw-r--r-- | ipc/ipc_message_macros.h | 8 | ||||
-rw-r--r-- | ipc/ipc_message_utils.h | 10 | ||||
-rw-r--r-- | ipc/ipc_sync_message.cc | 2 | ||||
-rw-r--r-- | ipc/ipc_sync_message.h | 2 |
9 files changed, 27 insertions, 27 deletions
diff --git a/ipc/ipc_channel_posix.cc b/ipc/ipc_channel_posix.cc index cce2c03..0d178d5 100644 --- a/ipc/ipc_channel_posix.cc +++ b/ipc/ipc_channel_posix.cc @@ -772,7 +772,9 @@ bool Channel::ChannelImpl::ProcessOutgoingMessages() { reinterpret_cast<int*>(CMSG_DATA(cmsg))); msgh.msg_controllen = cmsg->cmsg_len; - msg->header()->num_fds = num_fds; + // DCHECK_LE above already checks that + // num_fds < MAX_DESCRIPTORS_PER_MESSAGE so no danger of overflow. + msg->header()->num_fds = static_cast<uint16>(num_fds); #if defined(OS_LINUX) if (!uses_fifo_ && diff --git a/ipc/ipc_logging.cc b/ipc/ipc_logging.cc index b2ee6bd..ac96666 100644 --- a/ipc/ipc_logging.cc +++ b/ipc/ipc_logging.cc @@ -157,13 +157,13 @@ void Logging::OnPostDispatchMessage(const Message& message, } } -void Logging::GetMessageText(uint16 type, std::wstring* name, +void Logging::GetMessageText(uint32 type, std::wstring* name, const Message* message, std::wstring* params) { if (!log_function_mapping_) return; - int message_class = type >> 12; + int message_class = type >> 16; if (log_function_mapping_[message_class] != NULL) { log_function_mapping_[message_class](type, name, message, params); } else { diff --git a/ipc/ipc_logging.h b/ipc/ipc_logging.h index e3bc33e..ad0559b 100644 --- a/ipc/ipc_logging.h +++ b/ipc/ipc_logging.h @@ -65,10 +65,10 @@ class Logging { // Like the *MsgLog functions declared for each message class, except this // calls the correct one based on the message type automatically. Defined in // ipc_logging.cc. - static void GetMessageText(uint16 type, std::wstring* name, + static void GetMessageText(uint32 type, std::wstring* name, const Message* message, std::wstring* params); - typedef void (*LogFunction)(uint16 type, + typedef void (*LogFunction)(uint32 type, std::wstring* name, const Message* msg, std::wstring* params); diff --git a/ipc/ipc_message.cc b/ipc/ipc_message.cc index 8b608b6..7e5b77b 100644 --- a/ipc/ipc_message.cc +++ b/ipc/ipc_message.cc @@ -27,7 +27,7 @@ Message::Message() InitLoggingVariables(); } -Message::Message(int32 routing_id, uint16 type, PriorityValue priority) +Message::Message(int32 routing_id, uint32 type, PriorityValue priority) : Pickle(sizeof(Header)) { header()->routing = routing_id; header()->type = type; @@ -121,4 +121,4 @@ void Message::EnsureFileDescriptorSet() { #endif -} // namespace IPC +} // namespace IPC
\ No newline at end of file diff --git a/ipc/ipc_message.h b/ipc/ipc_message.h index 6357c0b..8268fce 100644 --- a/ipc/ipc_message.h +++ b/ipc/ipc_message.h @@ -58,7 +58,7 @@ class Message : public Pickle { // Initialize a message with a user-defined type, priority value, and // destination WebView ID. - Message(int32 routing_id, uint16 type, PriorityValue priority); + Message(int32 routing_id, uint32 type, PriorityValue priority); // Initializes a message from a const block of data. The data is not copied; // instead the data is merely referenced by this message. Only const methods @@ -117,7 +117,7 @@ class Message : public Pickle { return (header()->flags & PUMPING_MSGS_BIT) != 0; } - uint16 type() const { + uint32 type() const { return header()->type; } @@ -216,13 +216,13 @@ class Message : public Pickle { HAS_SENT_TIME_BIT = 0x0080, }; -#pragma pack(push, 2) +#pragma pack(push, 4) struct Header : Pickle::Header { int32 routing; // ID of the view that this message is destined for - uint16 type; // specifies the user-defined message type - uint16 flags; // specifies control flags for the message + uint32 type; // specifies the user-defined message type + uint32 flags; // specifies control flags for the message #if defined(OS_POSIX) - uint32 num_fds; // the number of descriptors included with this message + uint16 num_fds; // the number of descriptors included with this message #endif }; #pragma pack(pop) @@ -273,7 +273,7 @@ enum SpecialRoutingIDs { MSG_ROUTING_CONTROL = kint32max, }; -#define IPC_REPLY_ID 0xFFF0 // Special message id for replies -#define IPC_LOGGING_ID 0xFFF1 // Special message id for logging +#define IPC_REPLY_ID 0xFFFFFFF0 // Special message id for replies +#define IPC_LOGGING_ID 0xFFFFFFF1 // Special message id for logging #endif // IPC_IPC_MESSAGE_H__ diff --git a/ipc/ipc_message_macros.h b/ipc/ipc_message_macros.h index ba2a10a..e46ab12 100644 --- a/ipc/ipc_message_macros.h +++ b/ipc/ipc_message_macros.h @@ -145,8 +145,8 @@ // Do label##PreStart so that automation messages keep the same id as before. #define IPC_BEGIN_MESSAGES(label) \ enum label##MsgType { \ - label##Start = label##MsgStart << 12, \ - label##PreStart = (label##MsgStart << 12) - 1, + label##Start = label##MsgStart << 16, \ + label##PreStart = (label##MsgStart << 16) - 1, #define IPC_END_MESSAGES(label) \ label##End \ @@ -387,7 +387,7 @@ void class_name::OnMessageReceived(const IPC::Message& msg) \ #ifndef IPC_LOG_TABLE_CREATED #define IPC_LOG_TABLE_CREATED -typedef void (*LogFunction)(uint16 type, +typedef void (*LogFunction)(uint32 type, std::wstring* name, const IPC::Message* msg, std::wstring* params); @@ -397,7 +397,7 @@ LogFunction g_log_function_mapping[LastMsgIndex]; #define IPC_BEGIN_MESSAGES(label) \ - void label##MsgLog(uint16 type, std::wstring* name, const IPC::Message* msg, std::wstring* params) { \ + void label##MsgLog(uint32 type, std::wstring* name, const IPC::Message* msg, std::wstring* params) { \ switch (type) { #define IPC_END_MESSAGES(label) \ diff --git a/ipc/ipc_message_utils.h b/ipc/ipc_message_utils.h index fd0c064..114ec25 100644 --- a/ipc/ipc_message_utils.h +++ b/ipc/ipc_message_utils.h @@ -45,11 +45,9 @@ enum IPCMessageStart { WorkerMsgStart, WorkerHostMsgStart, NaClProcessMsgStart, + //CommandBufferMsgStart, // NOTE: When you add a new message class, also update // IPCStatusView::IPCStatusView to ensure logging works. - // NOTE: this enum is used by IPC_MESSAGE_MACRO to generate a unique message - // id. Only 4 bits are used for the message type, so if this enum needs more - // than 16 entries, that code needs to be updated. LastMsgIndex }; @@ -782,7 +780,7 @@ struct ParamTraits<XFORM> { struct LogData { std::string channel; int32 routing_id; - uint16 type; // "User-defined" message type, from ipc_message.h. + uint32 type; // "User-defined" message type, from ipc_message.h. std::wstring flags; int64 sent; // Time that the message was sent (i.e. at Send()). int64 receive; // Time before it was dispatched (i.e. before calling @@ -978,7 +976,7 @@ class MessageWithTuple : public Message { typedef ParamType Param; typedef typename ParamType::ParamTuple RefParam; - MessageWithTuple(int32 routing_id, uint16 type, const RefParam& p) + MessageWithTuple(int32 routing_id, uint32 type, const RefParam& p) : Message(routing_id, type, PRIORITY_NORMAL) { WriteParam(this, p); } @@ -1142,7 +1140,7 @@ class MessageWithReply : public SyncMessage { typedef typename SendParam::ParamTuple RefSendParam; typedef ReplyParamType ReplyParam; - MessageWithReply(int32 routing_id, uint16 type, + MessageWithReply(int32 routing_id, uint32 type, const RefSendParam& send, const ReplyParam& reply) : SyncMessage(routing_id, type, PRIORITY_NORMAL, new ParamDeserializer<ReplyParam>(reply)) { diff --git a/ipc/ipc_sync_message.cc b/ipc/ipc_sync_message.cc index 519adb1..23f3d16 100644 --- a/ipc/ipc_sync_message.cc +++ b/ipc/ipc_sync_message.cc @@ -22,7 +22,7 @@ base::WaitableEvent* dummy_event = new base::WaitableEvent(true, true); SyncMessage::SyncMessage( int32 routing_id, - uint16 type, + uint32 type, PriorityValue priority, MessageReplyDeserializer* deserializer) : Message(routing_id, type, priority), diff --git a/ipc/ipc_sync_message.h b/ipc/ipc_sync_message.h index 5d072a7..37c6c71 100644 --- a/ipc/ipc_sync_message.h +++ b/ipc/ipc_sync_message.h @@ -22,7 +22,7 @@ class MessageReplyDeserializer; class SyncMessage : public Message { public: - SyncMessage(int32 routing_id, uint16 type, PriorityValue priority, + SyncMessage(int32 routing_id, uint32 type, PriorityValue priority, MessageReplyDeserializer* deserializer); // Call this to get a deserializer for the output parameters. |