Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2295)

Unified Diff: base/process/process_metrics.h

Issue 2826123004: Use faster, but less information methods to calculate memory dumps on macOS. (Closed)
Patch Set: comments form mark, primiano. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/process/process_metrics_mac.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « no previous file | base/process/process_metrics_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698