OLD | NEW |
---|---|
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 BASE_MACH_IPC_MAC_H_ | 5 #ifndef BASE_MACH_IPC_MAC_H_ |
6 #define BASE_MACH_IPC_MAC_H_ | 6 #define BASE_MACH_IPC_MAC_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <mach/mach.h> | 9 #include <mach/mach.h> |
10 #include <mach/message.h> | 10 #include <mach/message.h> |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
216 struct MachMessageData { | 216 struct MachMessageData { |
217 mach_msg_header_t head; | 217 mach_msg_header_t head; |
218 mach_msg_body_t body; | 218 mach_msg_body_t body; |
219 // descriptors and data may be embedded here. | 219 // descriptors and data may be embedded here. |
220 u_int8_t padding[1024]; | 220 u_int8_t padding[1024]; |
221 }; | 221 }; |
222 | 222 |
223 // kEmptyMessageSize needs to have the definition of MachMessageData before | 223 // kEmptyMessageSize needs to have the definition of MachMessageData before |
224 // it. | 224 // it. |
225 public: | 225 public: |
226 // The size of an empty message with no data. | 226 // The size of an empty message (defined in .mm file) |
227 static const size_t kEmptyMessageSize = sizeof(mach_msg_header_t) + | 227 static const size_t kEmptyMessageSize; |
Peter Kasting
2011/03/26 19:11:47
Nit: No need for comment about where it's defined
KushalP
2011/03/26 20:23:14
Done.
| |
228 sizeof(mach_msg_body_t) + | |
229 sizeof(MessageDataPacket); | |
230 | 228 |
231 private: | 229 private: |
232 MachMessageData *storage_; | 230 MachMessageData *storage_; |
233 size_t storage_length_bytes_; | 231 size_t storage_length_bytes_; |
234 bool own_storage_; // Is storage owned by this object? | 232 bool own_storage_; // Is storage owned by this object? |
235 }; | 233 }; |
236 | 234 |
237 //============================================================================== | 235 //============================================================================== |
238 // MachReceiveMessage and MachSendMessage are useful to separate the idea | 236 // MachReceiveMessage and MachSendMessage are useful to separate the idea |
239 // of a Mach message being sent and being received, and adds increased type | 237 // of a Mach message being sent and being received, and adds increased type |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
313 private: | 311 private: |
314 mach_port_t send_port_; | 312 mach_port_t send_port_; |
315 kern_return_t init_result_; | 313 kern_return_t init_result_; |
316 | 314 |
317 DISALLOW_COPY_AND_ASSIGN(MachPortSender); | 315 DISALLOW_COPY_AND_ASSIGN(MachPortSender); |
318 }; | 316 }; |
319 | 317 |
320 } // namespace base | 318 } // namespace base |
321 | 319 |
322 #endif // BASE_MACH_IPC_MAC_H_ | 320 #endif // BASE_MACH_IPC_MAC_H_ |
OLD | NEW |