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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 } | 107 } |
108 | 108 |
109 mach_port_t GetMachPort() const { | 109 mach_port_t GetMachPort() const { |
110 return name; | 110 return name; |
111 } | 111 } |
112 | 112 |
113 mach_msg_type_name_t GetDisposition() const { | 113 mach_msg_type_name_t GetDisposition() const { |
114 return disposition; | 114 return disposition; |
115 } | 115 } |
116 | 116 |
117 // We're just a simple wrapper for mach_msg_port_descriptor_t | |
118 // and have the same memory layout | |
119 operator mach_msg_port_descriptor_t&() { | |
120 return *this; | |
121 } | |
122 | |
123 // For convenience | 117 // For convenience |
124 operator mach_port_t() const { | 118 operator mach_port_t() const { |
125 return GetMachPort(); | 119 return GetMachPort(); |
126 } | 120 } |
127 }; | 121 }; |
128 | 122 |
129 //============================================================================== | 123 //============================================================================== |
130 // MachMessage: a wrapper for a Mach message | 124 // MachMessage: a wrapper for a Mach message |
131 // (mach_msg_header_t, mach_msg_body_t, extra data) | 125 // (mach_msg_header_t, mach_msg_body_t, extra data) |
132 // | 126 // |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 private: | 313 private: |
320 mach_port_t send_port_; | 314 mach_port_t send_port_; |
321 kern_return_t init_result_; | 315 kern_return_t init_result_; |
322 | 316 |
323 DISALLOW_COPY_AND_ASSIGN(MachPortSender); | 317 DISALLOW_COPY_AND_ASSIGN(MachPortSender); |
324 }; | 318 }; |
325 | 319 |
326 } // namespace base | 320 } // namespace base |
327 | 321 |
328 #endif // BASE_MACH_IPC_MAC_H_ | 322 #endif // BASE_MACH_IPC_MAC_H_ |
OLD | NEW |