OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef IPC_IPC_MESSAGE_H_ | 5 #ifndef IPC_IPC_MESSAGE_H_ |
6 #define IPC_IPC_MESSAGE_H_ | 6 #define IPC_IPC_MESSAGE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 } | 138 } |
139 | 139 |
140 void set_routing_id(int32_t new_id) { | 140 void set_routing_id(int32_t new_id) { |
141 header()->routing = new_id; | 141 header()->routing = new_id; |
142 } | 142 } |
143 | 143 |
144 uint32_t flags() const { | 144 uint32_t flags() const { |
145 return header()->flags; | 145 return header()->flags; |
146 } | 146 } |
147 | 147 |
| 148 bool ebs_enabled() const { |
| 149 return header()->ebs_enabled; |
| 150 } |
| 151 |
| 152 uint32_t qos_type() const { |
| 153 return header()->qos_type; |
| 154 } |
| 155 |
| 156 int qos_target() const { |
| 157 return header()->qos_target; |
| 158 } |
| 159 |
| 160 void set_ebs_enabled(bool enabled) { |
| 161 header()->ebs_enabled = enabled; |
| 162 } |
| 163 |
| 164 void set_qos_type(char type) { |
| 165 header()->qos_type = type; |
| 166 } |
| 167 |
| 168 void set_qos_target(int target) { |
| 169 header()->qos_target = target; |
| 170 } |
| 171 |
148 // Sets all the given header values. The message should be empty at this | 172 // Sets all the given header values. The message should be empty at this |
149 // call. | 173 // call. |
150 void SetHeaderValues(int32_t routing, uint32_t type, uint32_t flags); | 174 void SetHeaderValues(int32_t routing, uint32_t type, uint32_t flags); |
151 | 175 |
152 template<class T, class S, class P> | 176 template<class T, class S, class P> |
153 static bool Dispatch(const Message* msg, T* obj, S* sender, P* parameter, | 177 static bool Dispatch(const Message* msg, T* obj, S* sender, P* parameter, |
154 void (T::*func)()) { | 178 void (T::*func)()) { |
155 (obj->*func)(); | 179 (obj->*func)(); |
156 return true; | 180 return true; |
157 } | 181 } |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 friend class ChannelWin; | 285 friend class ChannelWin; |
262 friend class internal::ChannelReader; | 286 friend class internal::ChannelReader; |
263 friend class MessageReplyDeserializer; | 287 friend class MessageReplyDeserializer; |
264 friend class SyncMessage; | 288 friend class SyncMessage; |
265 | 289 |
266 #pragma pack(push, 4) | 290 #pragma pack(push, 4) |
267 struct Header : base::Pickle::Header { | 291 struct Header : base::Pickle::Header { |
268 int32_t routing; // ID of the view that this message is destined for | 292 int32_t routing; // ID of the view that this message is destined for |
269 uint32_t type; // specifies the user-defined message type | 293 uint32_t type; // specifies the user-defined message type |
270 uint32_t flags; // specifies control flags for the message | 294 uint32_t flags; // specifies control flags for the message |
| 295 char qos_type; // specifies the QoS type of an event. It's a hack for the
general flameblaming idea |
| 296 int qos_target; // specifies the QoS target of an event. |
| 297 bool ebs_enabled; // specifies whether ebs is enabled |
271 #if defined(OS_MACOSX) | 298 #if defined(OS_MACOSX) |
272 // The number of brokered attachments included with this message. The | 299 // The number of brokered attachments included with this message. The |
273 // ids of the brokered attachment ids are sent immediately after the pickled | 300 // ids of the brokered attachment ids are sent immediately after the pickled |
274 // message, before the next pickled message is sent. | 301 // message, before the next pickled message is sent. |
275 uint32_t num_brokered_attachments; | 302 uint32_t num_brokered_attachments; |
276 #endif | 303 #endif |
277 #if defined(OS_POSIX) | 304 #if defined(OS_POSIX) |
278 uint16_t num_fds; // the number of descriptors included with this message | 305 uint16_t num_fds; // the number of descriptors included with this message |
279 uint16_t pad; // explicitly initialize this to appease valgrind | 306 uint16_t pad; // explicitly initialize this to appease valgrind |
280 #endif | 307 #endif |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 MSG_ROUTING_NONE = -2, | 359 MSG_ROUTING_NONE = -2, |
333 | 360 |
334 // indicates a general message not sent to a particular tab. | 361 // indicates a general message not sent to a particular tab. |
335 MSG_ROUTING_CONTROL = INT32_MAX, | 362 MSG_ROUTING_CONTROL = INT32_MAX, |
336 }; | 363 }; |
337 | 364 |
338 #define IPC_REPLY_ID 0xFFFFFFF0 // Special message id for replies | 365 #define IPC_REPLY_ID 0xFFFFFFF0 // Special message id for replies |
339 #define IPC_LOGGING_ID 0xFFFFFFF1 // Special message id for logging | 366 #define IPC_LOGGING_ID 0xFFFFFFF1 // Special message id for logging |
340 | 367 |
341 #endif // IPC_IPC_MESSAGE_H_ | 368 #endif // IPC_IPC_MESSAGE_H_ |
OLD | NEW |