OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 // This file contains Mac-specific utility functions used by multiple test | 5 // This file contains Mac-specific utility functions used by multiple test |
6 // suites. | 6 // suites. |
7 | 7 |
8 #ifndef IPC_TEST_UTIL_MAC_H_ | 8 #ifndef IPC_TEST_UTIL_MAC_H_ |
9 #define IPC_TEST_UTIL_MAC_H_ | 9 #define IPC_TEST_UTIL_MAC_H_ |
10 | 10 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 // The number of active names in the current task's port name space. | 43 // The number of active names in the current task's port name space. |
44 mach_msg_type_number_t GetActiveNameCount(); | 44 mach_msg_type_number_t GetActiveNameCount(); |
45 | 45 |
46 // The number of references the current task has for a given name. | 46 // The number of references the current task has for a given name. |
47 mach_port_urefs_t GetMachRefCount(mach_port_name_t name, | 47 mach_port_urefs_t GetMachRefCount(mach_port_name_t name, |
48 mach_port_right_t right); | 48 mach_port_right_t right); |
49 | 49 |
50 // Increments the ref count for the right/name pair. | 50 // Increments the ref count for the right/name pair. |
51 void IncrementMachRefCount(mach_port_name_t name, mach_port_right_t right); | 51 void IncrementMachRefCount(mach_port_name_t name, mach_port_right_t right); |
52 | 52 |
| 53 // Gets the current and maximum protection levels of the memory region. |
| 54 // Returns whether the operation was successful. |
| 55 // |current| and |max| are output variables only populated on success. |
| 56 bool GetMachProtections(void* address, size_t size, int* current, int* max); |
| 57 |
53 } // namespace IPC | 58 } // namespace IPC |
54 | 59 |
55 #endif // IPC_TEST_UTIL_MAC_H_ | 60 #endif // IPC_TEST_UTIL_MAC_H_ |
OLD | NEW |