Index: base/process/process_metrics.h |
diff --git a/base/process/process_metrics.h b/base/process/process_metrics.h |
index 1562e7b156af082292b3c8a4753a4b26fb7ecfcd..9c1ea9d9281dea2f780b2d6375806888b2b68a61 100644 |
--- a/base/process/process_metrics.h |
+++ b/base/process/process_metrics.h |
@@ -25,6 +25,10 @@ |
#if defined(OS_MACOSX) |
#include <mach/mach.h> |
#include "base/process/port_provider_mac.h" |
+ |
+#if !defined(OS_IOS) |
+#include <mach/mach_vm.h> |
+#endif |
#endif |
#if defined(OS_WIN) |
@@ -478,6 +482,42 @@ class SystemMetrics { |
#endif |
}; |
+#if defined(OS_MACOSX) && !defined(OS_IOS) |
+enum class MachVMRegionResult { |
+ // There were no more memory regions between |address| and the end of the |
+ // virtual address space. |
+ Finished, |
+ |
+ // All output parameters are invalid. |
+ Error, |
+ |
+ // All output parameters are filled in. |
+ Success |
+}; |
+ |
+// Returns info on the first memory region at or after |address|, including |
+// resident memory and share mode. On Success, |size| reflects the size of the |
+// memory region. |
+// |size| and |info| are output parameters, only valid on Success. |
+// |address| is an in-out parameter, than represents both the address to start |
+// looking, and the start address of the memory region. |
+BASE_EXPORT MachVMRegionResult GetTopInfo(mach_port_t task, |
+ mach_vm_size_t* size, |
+ mach_vm_address_t* address, |
+ vm_region_top_info_data_t* info); |
+ |
+// Returns info on the first memory region at or after |address|, including |
+// protection values. On Success, |size| reflects the size of the |
+// memory region. |
+// Returns info on the first memory region at or after |address|, including |
+// resident memory and share mode. |
+// |size| and |info| are output parameters, only valid on Success. |
+BASE_EXPORT MachVMRegionResult GetBasicInfo(mach_port_t task, |
+ mach_vm_size_t* size, |
+ mach_vm_address_t* address, |
+ vm_region_basic_info_64* info); |
+#endif // defined(OS_MACOSX) && !defined(OS_IOS) |
+ |
} // namespace base |
#endif // BASE_PROCESS_PROCESS_METRICS_H_ |