OLD | NEW |
1 // Copyright 2014 The Crashpad Authors. All rights reserved. | 1 // Copyright 2014 The Crashpad Authors. All rights reserved. |
2 // | 2 // |
3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
6 // | 6 // |
7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
8 // | 8 // |
9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 size_t user_size_; | 81 size_t user_size_; |
82 | 82 |
83 // The outer class needs to be able to call this class’ private constructor. | 83 // The outer class needs to be able to call this class’ private constructor. |
84 friend class TaskMemory; | 84 friend class TaskMemory; |
85 | 85 |
86 DISALLOW_COPY_AND_ASSIGN(MappedMemory); | 86 DISALLOW_COPY_AND_ASSIGN(MappedMemory); |
87 }; | 87 }; |
88 | 88 |
89 //! \param[in] task A send right to the target task’s task port. This object | 89 //! \param[in] task A send right to the target task’s task port. This object |
90 //! does not take ownership of the send right. | 90 //! does not take ownership of the send right. |
91 explicit TaskMemory(mach_port_t task); | 91 explicit TaskMemory(task_t task); |
92 | 92 |
93 ~TaskMemory() {} | 93 ~TaskMemory() {} |
94 | 94 |
95 //! \brief Copies memory from the target task into a caller-provided buffer in | 95 //! \brief Copies memory from the target task into a caller-provided buffer in |
96 //! the current task. | 96 //! the current task. |
97 //! | 97 //! |
98 //! \param[in] address The address, in the target task’s address space, of the | 98 //! \param[in] address The address, in the target task’s address space, of the |
99 //! memory region to copy. | 99 //! memory region to copy. |
100 //! \param[in] size The size, in bytes, of the memory region to copy. \a | 100 //! \param[in] size The size, in bytes, of the memory region to copy. \a |
101 //! buffer must be at least this size. | 101 //! buffer must be at least this size. |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 mach_vm_size_t size, | 160 mach_vm_size_t size, |
161 std::string* string); | 161 std::string* string); |
162 | 162 |
163 private: | 163 private: |
164 // The common internal implementation shared by the ReadCString*() methods. | 164 // The common internal implementation shared by the ReadCString*() methods. |
165 bool ReadCStringInternal(mach_vm_address_t address, | 165 bool ReadCStringInternal(mach_vm_address_t address, |
166 bool has_size, | 166 bool has_size, |
167 mach_vm_size_t size, | 167 mach_vm_size_t size, |
168 std::string* string); | 168 std::string* string); |
169 | 169 |
170 mach_port_t task_; // weak | 170 task_t task_; // weak |
171 | 171 |
172 DISALLOW_COPY_AND_ASSIGN(TaskMemory); | 172 DISALLOW_COPY_AND_ASSIGN(TaskMemory); |
173 }; | 173 }; |
174 | 174 |
175 } // namespace crashpad | 175 } // namespace crashpad |
176 | 176 |
177 #endif // CRASHPAD_UTIL_MACH_TASK_MEMORY_H_ | 177 #endif // CRASHPAD_UTIL_MACH_TASK_MEMORY_H_ |
OLD | NEW |