Index: base/process/process_metrics.h |
diff --git a/base/process/process_metrics.h b/base/process/process_metrics.h |
index 54b10aaacfa2f5cfb0ab3ffc702fbc226435c325..4dd2eb3de0ffd5acef38cf70561f6cfedd95dd9e 100644 |
--- a/base/process/process_metrics.h |
+++ b/base/process/process_metrics.h |
@@ -307,6 +307,14 @@ BASE_EXPORT bool GetSystemMemoryInfo(SystemMemoryInfoKB* meminfo); |
// Exposed for testing. |
BASE_EXPORT int ParseProcStatCPU(const std::string& input); |
+// Parses the /proc/<pid>/status file contents passed and sets |value| to the |
+// size in bytes corresponding to the |field|. Only works for fields in the form |
+// of "Field: value kB". Returns true on success. |
+BASE_EXPORT bool ParseProcStatusAndGetField( |
+ const base::StringPiece& proc_status_contents, |
+ const std::string& field, |
+ size_t* value); |
+ |
// Get the number of threads of |process| as available in /proc/<pid>/stat. |
// This should be used with care as no synchronization with running threads is |
// done. This is mostly useful to guarantee being single-threaded. |