xref: /aosp_15_r20/external/libchrome/ipc/ipc_message.h (revision 635a864187cb8b6c713ff48b7e790a6b21769273)
1*635a8641SAndroid Build Coastguard Worker // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2*635a8641SAndroid Build Coastguard Worker // Use of this source code is governed by a BSD-style license that can be
3*635a8641SAndroid Build Coastguard Worker // found in the LICENSE file.
4*635a8641SAndroid Build Coastguard Worker 
5*635a8641SAndroid Build Coastguard Worker #ifndef IPC_IPC_MESSAGE_H_
6*635a8641SAndroid Build Coastguard Worker #define IPC_IPC_MESSAGE_H_
7*635a8641SAndroid Build Coastguard Worker 
8*635a8641SAndroid Build Coastguard Worker #include <stddef.h>
9*635a8641SAndroid Build Coastguard Worker #include <stdint.h>
10*635a8641SAndroid Build Coastguard Worker 
11*635a8641SAndroid Build Coastguard Worker #include <string>
12*635a8641SAndroid Build Coastguard Worker 
13*635a8641SAndroid Build Coastguard Worker #include "base/gtest_prod_util.h"
14*635a8641SAndroid Build Coastguard Worker #include "base/memory/ref_counted.h"
15*635a8641SAndroid Build Coastguard Worker #include "base/pickle.h"
16*635a8641SAndroid Build Coastguard Worker #include "base/trace_event/trace_event.h"
17*635a8641SAndroid Build Coastguard Worker #include "build/build_config.h"
18*635a8641SAndroid Build Coastguard Worker #include "ipc/ipc_buildflags.h"
19*635a8641SAndroid Build Coastguard Worker #include "ipc/ipc_message_support_export.h"
20*635a8641SAndroid Build Coastguard Worker 
21*635a8641SAndroid Build Coastguard Worker namespace mojo {
22*635a8641SAndroid Build Coastguard Worker namespace internal {
23*635a8641SAndroid Build Coastguard Worker struct UnmappedNativeStructSerializerImpl;
24*635a8641SAndroid Build Coastguard Worker }
25*635a8641SAndroid Build Coastguard Worker }  // namespace mojo
26*635a8641SAndroid Build Coastguard Worker 
27*635a8641SAndroid Build Coastguard Worker namespace IPC {
28*635a8641SAndroid Build Coastguard Worker 
29*635a8641SAndroid Build Coastguard Worker namespace internal {
30*635a8641SAndroid Build Coastguard Worker class ChannelReader;
31*635a8641SAndroid Build Coastguard Worker }  // namespace internal
32*635a8641SAndroid Build Coastguard Worker 
33*635a8641SAndroid Build Coastguard Worker //------------------------------------------------------------------------------
34*635a8641SAndroid Build Coastguard Worker 
35*635a8641SAndroid Build Coastguard Worker struct LogData;
36*635a8641SAndroid Build Coastguard Worker class MessageAttachmentSet;
37*635a8641SAndroid Build Coastguard Worker 
38*635a8641SAndroid Build Coastguard Worker class IPC_MESSAGE_SUPPORT_EXPORT Message : public base::Pickle {
39*635a8641SAndroid Build Coastguard Worker  public:
40*635a8641SAndroid Build Coastguard Worker   enum PriorityValue {
41*635a8641SAndroid Build Coastguard Worker     PRIORITY_LOW = 1,
42*635a8641SAndroid Build Coastguard Worker     PRIORITY_NORMAL,
43*635a8641SAndroid Build Coastguard Worker     PRIORITY_HIGH
44*635a8641SAndroid Build Coastguard Worker   };
45*635a8641SAndroid Build Coastguard Worker 
46*635a8641SAndroid Build Coastguard Worker   // Bit values used in the flags field.
47*635a8641SAndroid Build Coastguard Worker   // Upper 24 bits of flags store a reference number, so this enum is limited to
48*635a8641SAndroid Build Coastguard Worker   // 8 bits.
49*635a8641SAndroid Build Coastguard Worker   enum {
50*635a8641SAndroid Build Coastguard Worker     PRIORITY_MASK     = 0x03,  // Low 2 bits of store the priority value.
51*635a8641SAndroid Build Coastguard Worker     SYNC_BIT          = 0x04,
52*635a8641SAndroid Build Coastguard Worker     REPLY_BIT         = 0x08,
53*635a8641SAndroid Build Coastguard Worker     REPLY_ERROR_BIT   = 0x10,
54*635a8641SAndroid Build Coastguard Worker     UNBLOCK_BIT       = 0x20,
55*635a8641SAndroid Build Coastguard Worker     PUMPING_MSGS_BIT  = 0x40,
56*635a8641SAndroid Build Coastguard Worker     HAS_SENT_TIME_BIT = 0x80,
57*635a8641SAndroid Build Coastguard Worker   };
58*635a8641SAndroid Build Coastguard Worker 
59*635a8641SAndroid Build Coastguard Worker   ~Message() override;
60*635a8641SAndroid Build Coastguard Worker 
61*635a8641SAndroid Build Coastguard Worker   Message();
62*635a8641SAndroid Build Coastguard Worker 
63*635a8641SAndroid Build Coastguard Worker   // Initialize a message with a user-defined type, priority value, and
64*635a8641SAndroid Build Coastguard Worker   // destination WebView ID.
65*635a8641SAndroid Build Coastguard Worker   Message(int32_t routing_id, uint32_t type, PriorityValue priority);
66*635a8641SAndroid Build Coastguard Worker 
67*635a8641SAndroid Build Coastguard Worker   // Initializes a message from a const block of data.  The data is not copied;
68*635a8641SAndroid Build Coastguard Worker   // instead the data is merely referenced by this message.  Only const methods
69*635a8641SAndroid Build Coastguard Worker   // should be used on the message when initialized this way.
70*635a8641SAndroid Build Coastguard Worker   Message(const char* data, int data_len);
71*635a8641SAndroid Build Coastguard Worker 
72*635a8641SAndroid Build Coastguard Worker   Message(const Message& other);
73*635a8641SAndroid Build Coastguard Worker   Message& operator=(const Message& other);
74*635a8641SAndroid Build Coastguard Worker 
IsValid()75*635a8641SAndroid Build Coastguard Worker   bool IsValid() const { return header_size() == sizeof(Header) && header(); }
76*635a8641SAndroid Build Coastguard Worker 
priority()77*635a8641SAndroid Build Coastguard Worker   PriorityValue priority() const {
78*635a8641SAndroid Build Coastguard Worker     return static_cast<PriorityValue>(header()->flags & PRIORITY_MASK);
79*635a8641SAndroid Build Coastguard Worker   }
80*635a8641SAndroid Build Coastguard Worker 
81*635a8641SAndroid Build Coastguard Worker   // True if this is a synchronous message.
set_sync()82*635a8641SAndroid Build Coastguard Worker   void set_sync() {
83*635a8641SAndroid Build Coastguard Worker     header()->flags |= SYNC_BIT;
84*635a8641SAndroid Build Coastguard Worker   }
is_sync()85*635a8641SAndroid Build Coastguard Worker   bool is_sync() const {
86*635a8641SAndroid Build Coastguard Worker     return (header()->flags & SYNC_BIT) != 0;
87*635a8641SAndroid Build Coastguard Worker   }
88*635a8641SAndroid Build Coastguard Worker 
89*635a8641SAndroid Build Coastguard Worker   // Set this on a reply to a synchronous message.
set_reply()90*635a8641SAndroid Build Coastguard Worker   void set_reply() {
91*635a8641SAndroid Build Coastguard Worker     header()->flags |= REPLY_BIT;
92*635a8641SAndroid Build Coastguard Worker   }
93*635a8641SAndroid Build Coastguard Worker 
is_reply()94*635a8641SAndroid Build Coastguard Worker   bool is_reply() const {
95*635a8641SAndroid Build Coastguard Worker     return (header()->flags & REPLY_BIT) != 0;
96*635a8641SAndroid Build Coastguard Worker   }
97*635a8641SAndroid Build Coastguard Worker 
98*635a8641SAndroid Build Coastguard Worker   // Set this on a reply to a synchronous message to indicate that no receiver
99*635a8641SAndroid Build Coastguard Worker   // was found.
set_reply_error()100*635a8641SAndroid Build Coastguard Worker   void set_reply_error() {
101*635a8641SAndroid Build Coastguard Worker     header()->flags |= REPLY_ERROR_BIT;
102*635a8641SAndroid Build Coastguard Worker   }
103*635a8641SAndroid Build Coastguard Worker 
is_reply_error()104*635a8641SAndroid Build Coastguard Worker   bool is_reply_error() const {
105*635a8641SAndroid Build Coastguard Worker     return (header()->flags & REPLY_ERROR_BIT) != 0;
106*635a8641SAndroid Build Coastguard Worker   }
107*635a8641SAndroid Build Coastguard Worker 
108*635a8641SAndroid Build Coastguard Worker   // Normally when a receiver gets a message and they're blocked on a
109*635a8641SAndroid Build Coastguard Worker   // synchronous message Send, they buffer a message.  Setting this flag causes
110*635a8641SAndroid Build Coastguard Worker   // the receiver to be unblocked and the message to be dispatched immediately.
set_unblock(bool unblock)111*635a8641SAndroid Build Coastguard Worker   void set_unblock(bool unblock) {
112*635a8641SAndroid Build Coastguard Worker     if (unblock) {
113*635a8641SAndroid Build Coastguard Worker       header()->flags |= UNBLOCK_BIT;
114*635a8641SAndroid Build Coastguard Worker     } else {
115*635a8641SAndroid Build Coastguard Worker       header()->flags &= ~UNBLOCK_BIT;
116*635a8641SAndroid Build Coastguard Worker     }
117*635a8641SAndroid Build Coastguard Worker   }
118*635a8641SAndroid Build Coastguard Worker 
should_unblock()119*635a8641SAndroid Build Coastguard Worker   bool should_unblock() const {
120*635a8641SAndroid Build Coastguard Worker     return (header()->flags & UNBLOCK_BIT) != 0;
121*635a8641SAndroid Build Coastguard Worker   }
122*635a8641SAndroid Build Coastguard Worker 
123*635a8641SAndroid Build Coastguard Worker   // Tells the receiver that the caller is pumping messages while waiting
124*635a8641SAndroid Build Coastguard Worker   // for the result.
is_caller_pumping_messages()125*635a8641SAndroid Build Coastguard Worker   bool is_caller_pumping_messages() const {
126*635a8641SAndroid Build Coastguard Worker     return (header()->flags & PUMPING_MSGS_BIT) != 0;
127*635a8641SAndroid Build Coastguard Worker   }
128*635a8641SAndroid Build Coastguard Worker 
set_dispatch_error()129*635a8641SAndroid Build Coastguard Worker   void set_dispatch_error() const {
130*635a8641SAndroid Build Coastguard Worker     dispatch_error_ = true;
131*635a8641SAndroid Build Coastguard Worker   }
132*635a8641SAndroid Build Coastguard Worker 
dispatch_error()133*635a8641SAndroid Build Coastguard Worker   bool dispatch_error() const {
134*635a8641SAndroid Build Coastguard Worker     return dispatch_error_;
135*635a8641SAndroid Build Coastguard Worker   }
136*635a8641SAndroid Build Coastguard Worker 
type()137*635a8641SAndroid Build Coastguard Worker   uint32_t type() const {
138*635a8641SAndroid Build Coastguard Worker     return header()->type;
139*635a8641SAndroid Build Coastguard Worker   }
140*635a8641SAndroid Build Coastguard Worker 
routing_id()141*635a8641SAndroid Build Coastguard Worker   int32_t routing_id() const {
142*635a8641SAndroid Build Coastguard Worker     return header()->routing;
143*635a8641SAndroid Build Coastguard Worker   }
144*635a8641SAndroid Build Coastguard Worker 
set_routing_id(int32_t new_id)145*635a8641SAndroid Build Coastguard Worker   void set_routing_id(int32_t new_id) {
146*635a8641SAndroid Build Coastguard Worker     header()->routing = new_id;
147*635a8641SAndroid Build Coastguard Worker   }
148*635a8641SAndroid Build Coastguard Worker 
flags()149*635a8641SAndroid Build Coastguard Worker   uint32_t flags() const {
150*635a8641SAndroid Build Coastguard Worker     return header()->flags;
151*635a8641SAndroid Build Coastguard Worker   }
152*635a8641SAndroid Build Coastguard Worker 
153*635a8641SAndroid Build Coastguard Worker   // Sets all the given header values. The message should be empty at this
154*635a8641SAndroid Build Coastguard Worker   // call.
155*635a8641SAndroid Build Coastguard Worker   void SetHeaderValues(int32_t routing, uint32_t type, uint32_t flags);
156*635a8641SAndroid Build Coastguard Worker 
157*635a8641SAndroid Build Coastguard Worker   template<class T, class S, class P>
Dispatch(const Message * msg,T * obj,S * sender,P * parameter,void (T::* func)())158*635a8641SAndroid Build Coastguard Worker   static bool Dispatch(const Message* msg, T* obj, S* sender, P* parameter,
159*635a8641SAndroid Build Coastguard Worker                        void (T::*func)()) {
160*635a8641SAndroid Build Coastguard Worker     (obj->*func)();
161*635a8641SAndroid Build Coastguard Worker     return true;
162*635a8641SAndroid Build Coastguard Worker   }
163*635a8641SAndroid Build Coastguard Worker 
164*635a8641SAndroid Build Coastguard Worker   template<class T, class S, class P>
Dispatch(const Message * msg,T * obj,S * sender,P * parameter,void (T::* func)(P *))165*635a8641SAndroid Build Coastguard Worker   static bool Dispatch(const Message* msg, T* obj, S* sender, P* parameter,
166*635a8641SAndroid Build Coastguard Worker                        void (T::*func)(P*)) {
167*635a8641SAndroid Build Coastguard Worker     (obj->*func)(parameter);
168*635a8641SAndroid Build Coastguard Worker     return true;
169*635a8641SAndroid Build Coastguard Worker   }
170*635a8641SAndroid Build Coastguard Worker 
171*635a8641SAndroid Build Coastguard Worker   // Used for async messages with no parameters.
Log(std::string * name,const Message * msg,std::string * l)172*635a8641SAndroid Build Coastguard Worker   static void Log(std::string* name, const Message* msg, std::string* l) {
173*635a8641SAndroid Build Coastguard Worker   }
174*635a8641SAndroid Build Coastguard Worker 
175*635a8641SAndroid Build Coastguard Worker   // The static method FindNext() returns several pieces of information, which
176*635a8641SAndroid Build Coastguard Worker   // are aggregated into an instance of this struct.
177*635a8641SAndroid Build Coastguard Worker   struct IPC_MESSAGE_SUPPORT_EXPORT NextMessageInfo {
178*635a8641SAndroid Build Coastguard Worker     NextMessageInfo();
179*635a8641SAndroid Build Coastguard Worker     ~NextMessageInfo();
180*635a8641SAndroid Build Coastguard Worker 
181*635a8641SAndroid Build Coastguard Worker     // Total message size. Always valid if |message_found| is true.
182*635a8641SAndroid Build Coastguard Worker     // If |message_found| is false but we could determine message size
183*635a8641SAndroid Build Coastguard Worker     // from the header, this field is non-zero. Otherwise it's zero.
184*635a8641SAndroid Build Coastguard Worker     size_t message_size;
185*635a8641SAndroid Build Coastguard Worker     // Whether an entire message was found in the given memory range.
186*635a8641SAndroid Build Coastguard Worker     bool message_found;
187*635a8641SAndroid Build Coastguard Worker     // Only filled in if |message_found| is true.
188*635a8641SAndroid Build Coastguard Worker     // The start address is passed into FindNext() by the caller, so isn't
189*635a8641SAndroid Build Coastguard Worker     // repeated in this struct. The end address of the pickle should be used to
190*635a8641SAndroid Build Coastguard Worker     // construct a base::Pickle.
191*635a8641SAndroid Build Coastguard Worker     const char* pickle_end;
192*635a8641SAndroid Build Coastguard Worker     // Only filled in if |message_found| is true.
193*635a8641SAndroid Build Coastguard Worker     // The end address of the message should be used to determine the start
194*635a8641SAndroid Build Coastguard Worker     // address of the next message.
195*635a8641SAndroid Build Coastguard Worker     const char* message_end;
196*635a8641SAndroid Build Coastguard Worker   };
197*635a8641SAndroid Build Coastguard Worker 
198*635a8641SAndroid Build Coastguard Worker   // |info| is an output parameter and must not be nullptr.
199*635a8641SAndroid Build Coastguard Worker   static void FindNext(const char* range_start,
200*635a8641SAndroid Build Coastguard Worker                        const char* range_end,
201*635a8641SAndroid Build Coastguard Worker                        NextMessageInfo* info);
202*635a8641SAndroid Build Coastguard Worker 
203*635a8641SAndroid Build Coastguard Worker   // WriteAttachment appends |attachment| to the end of the set. It returns
204*635a8641SAndroid Build Coastguard Worker   // false iff the set is full.
205*635a8641SAndroid Build Coastguard Worker   bool WriteAttachment(
206*635a8641SAndroid Build Coastguard Worker       scoped_refptr<base::Pickle::Attachment> attachment) override;
207*635a8641SAndroid Build Coastguard Worker   // ReadAttachment parses an attachment given the parsing state |iter| and
208*635a8641SAndroid Build Coastguard Worker   // writes it to |*attachment|. It returns true on success.
209*635a8641SAndroid Build Coastguard Worker   bool ReadAttachment(
210*635a8641SAndroid Build Coastguard Worker       base::PickleIterator* iter,
211*635a8641SAndroid Build Coastguard Worker       scoped_refptr<base::Pickle::Attachment>* attachment) const override;
212*635a8641SAndroid Build Coastguard Worker   // Returns true if there are any attachment in this message.
213*635a8641SAndroid Build Coastguard Worker   bool HasAttachments() const override;
214*635a8641SAndroid Build Coastguard Worker 
215*635a8641SAndroid Build Coastguard Worker #if BUILDFLAG(IPC_MESSAGE_LOG_ENABLED)
216*635a8641SAndroid Build Coastguard Worker   // Adds the outgoing time from Time::Now() at the end of the message and sets
217*635a8641SAndroid Build Coastguard Worker   // a bit to indicate that it's been added.
218*635a8641SAndroid Build Coastguard Worker   void set_sent_time(int64_t time);
219*635a8641SAndroid Build Coastguard Worker   int64_t sent_time() const;
220*635a8641SAndroid Build Coastguard Worker 
221*635a8641SAndroid Build Coastguard Worker   void set_received_time(int64_t time) const;
received_time()222*635a8641SAndroid Build Coastguard Worker   int64_t received_time() const { return received_time_; }
set_output_params(const std::string & op)223*635a8641SAndroid Build Coastguard Worker   void set_output_params(const std::string& op) const { output_params_ = op; }
output_params()224*635a8641SAndroid Build Coastguard Worker   const std::string& output_params() const { return output_params_; }
225*635a8641SAndroid Build Coastguard Worker   // The following four functions are needed so we can log sync messages with
226*635a8641SAndroid Build Coastguard Worker   // delayed replies.  We stick the log data from the sent message into the
227*635a8641SAndroid Build Coastguard Worker   // reply message, so that when it's sent and we have the output parameters
228*635a8641SAndroid Build Coastguard Worker   // we can log it.  As such, we set a flag on the sent message to not log it.
set_sync_log_data(LogData * data)229*635a8641SAndroid Build Coastguard Worker   void set_sync_log_data(LogData* data) const { log_data_ = data; }
sync_log_data()230*635a8641SAndroid Build Coastguard Worker   LogData* sync_log_data() const { return log_data_; }
set_dont_log()231*635a8641SAndroid Build Coastguard Worker   void set_dont_log() const { dont_log_ = true; }
dont_log()232*635a8641SAndroid Build Coastguard Worker   bool dont_log() const { return dont_log_; }
233*635a8641SAndroid Build Coastguard Worker #endif
234*635a8641SAndroid Build Coastguard Worker 
235*635a8641SAndroid Build Coastguard Worker  protected:
236*635a8641SAndroid Build Coastguard Worker   friend class Channel;
237*635a8641SAndroid Build Coastguard Worker   friend class ChannelMojo;
238*635a8641SAndroid Build Coastguard Worker   friend class ChannelNacl;
239*635a8641SAndroid Build Coastguard Worker   friend class ChannelPosix;
240*635a8641SAndroid Build Coastguard Worker   friend class ChannelWin;
241*635a8641SAndroid Build Coastguard Worker   friend class internal::ChannelReader;
242*635a8641SAndroid Build Coastguard Worker   friend class MessageReplyDeserializer;
243*635a8641SAndroid Build Coastguard Worker   friend class SyncMessage;
244*635a8641SAndroid Build Coastguard Worker 
245*635a8641SAndroid Build Coastguard Worker   friend struct mojo::internal::UnmappedNativeStructSerializerImpl;
246*635a8641SAndroid Build Coastguard Worker 
247*635a8641SAndroid Build Coastguard Worker #pragma pack(push, 4)
248*635a8641SAndroid Build Coastguard Worker   struct Header : base::Pickle::Header {
249*635a8641SAndroid Build Coastguard Worker     int32_t routing;  // ID of the view that this message is destined for
250*635a8641SAndroid Build Coastguard Worker     uint32_t type;    // specifies the user-defined message type
251*635a8641SAndroid Build Coastguard Worker     uint32_t flags;   // specifies control flags for the message
252*635a8641SAndroid Build Coastguard Worker #if defined(OS_POSIX) || defined(OS_FUCHSIA)
253*635a8641SAndroid Build Coastguard Worker     uint16_t num_fds; // the number of descriptors included with this message
254*635a8641SAndroid Build Coastguard Worker     uint16_t pad;     // explicitly initialize this to appease valgrind
255*635a8641SAndroid Build Coastguard Worker #endif
256*635a8641SAndroid Build Coastguard Worker   };
257*635a8641SAndroid Build Coastguard Worker #pragma pack(pop)
258*635a8641SAndroid Build Coastguard Worker 
header()259*635a8641SAndroid Build Coastguard Worker   Header* header() {
260*635a8641SAndroid Build Coastguard Worker     return headerT<Header>();
261*635a8641SAndroid Build Coastguard Worker   }
header()262*635a8641SAndroid Build Coastguard Worker   const Header* header() const {
263*635a8641SAndroid Build Coastguard Worker     return headerT<Header>();
264*635a8641SAndroid Build Coastguard Worker   }
265*635a8641SAndroid Build Coastguard Worker 
266*635a8641SAndroid Build Coastguard Worker   void Init();
267*635a8641SAndroid Build Coastguard Worker 
268*635a8641SAndroid Build Coastguard Worker   // Used internally to support IPC::Listener::OnBadMessageReceived.
269*635a8641SAndroid Build Coastguard Worker   mutable bool dispatch_error_;
270*635a8641SAndroid Build Coastguard Worker 
271*635a8641SAndroid Build Coastguard Worker   // The set of file descriptors associated with this message.
272*635a8641SAndroid Build Coastguard Worker   scoped_refptr<MessageAttachmentSet> attachment_set_;
273*635a8641SAndroid Build Coastguard Worker 
274*635a8641SAndroid Build Coastguard Worker   // Ensure that a MessageAttachmentSet is allocated
275*635a8641SAndroid Build Coastguard Worker   void EnsureMessageAttachmentSet();
276*635a8641SAndroid Build Coastguard Worker 
attachment_set()277*635a8641SAndroid Build Coastguard Worker   MessageAttachmentSet* attachment_set() {
278*635a8641SAndroid Build Coastguard Worker     EnsureMessageAttachmentSet();
279*635a8641SAndroid Build Coastguard Worker     return attachment_set_.get();
280*635a8641SAndroid Build Coastguard Worker   }
attachment_set()281*635a8641SAndroid Build Coastguard Worker   const MessageAttachmentSet* attachment_set() const {
282*635a8641SAndroid Build Coastguard Worker     return attachment_set_.get();
283*635a8641SAndroid Build Coastguard Worker   }
284*635a8641SAndroid Build Coastguard Worker 
285*635a8641SAndroid Build Coastguard Worker #if BUILDFLAG(IPC_MESSAGE_LOG_ENABLED)
286*635a8641SAndroid Build Coastguard Worker   // Used for logging.
287*635a8641SAndroid Build Coastguard Worker   mutable int64_t received_time_;
288*635a8641SAndroid Build Coastguard Worker   mutable std::string output_params_;
289*635a8641SAndroid Build Coastguard Worker   mutable LogData* log_data_;
290*635a8641SAndroid Build Coastguard Worker   mutable bool dont_log_;
291*635a8641SAndroid Build Coastguard Worker #endif
292*635a8641SAndroid Build Coastguard Worker 
293*635a8641SAndroid Build Coastguard Worker   FRIEND_TEST_ALL_PREFIXES(IPCMessageTest, FindNext);
294*635a8641SAndroid Build Coastguard Worker   FRIEND_TEST_ALL_PREFIXES(IPCMessageTest, FindNextOverflow);
295*635a8641SAndroid Build Coastguard Worker };
296*635a8641SAndroid Build Coastguard Worker 
297*635a8641SAndroid Build Coastguard Worker //------------------------------------------------------------------------------
298*635a8641SAndroid Build Coastguard Worker 
299*635a8641SAndroid Build Coastguard Worker }  // namespace IPC
300*635a8641SAndroid Build Coastguard Worker 
301*635a8641SAndroid Build Coastguard Worker enum SpecialRoutingIDs {
302*635a8641SAndroid Build Coastguard Worker   // indicates that we don't have a routing ID yet.
303*635a8641SAndroid Build Coastguard Worker   MSG_ROUTING_NONE = -2,
304*635a8641SAndroid Build Coastguard Worker 
305*635a8641SAndroid Build Coastguard Worker   // indicates a general message not sent to a particular tab.
306*635a8641SAndroid Build Coastguard Worker   MSG_ROUTING_CONTROL = INT32_MAX,
307*635a8641SAndroid Build Coastguard Worker };
308*635a8641SAndroid Build Coastguard Worker 
309*635a8641SAndroid Build Coastguard Worker #define IPC_REPLY_ID 0xFFFFFFF0  // Special message id for replies
310*635a8641SAndroid Build Coastguard Worker #define IPC_LOGGING_ID 0xFFFFFFF1  // Special message id for logging
311*635a8641SAndroid Build Coastguard Worker 
312*635a8641SAndroid Build Coastguard Worker #endif  // IPC_IPC_MESSAGE_H_
313