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

Unified Diff: base/process/process_metrics.h

Issue 2858213002: Clean up base/process/process_metrics_linux.cc. (Closed)
Patch Set: constexpr is too much 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_linux.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 6586164f3e7811e1da61dec83c02dbd0b27ce15a..9747a1c16bd7f1409d2297b5a976d89de85fdeac 100644
--- a/base/process/process_metrics.h
+++ b/base/process/process_metrics.h
@@ -392,7 +392,7 @@ BASE_EXPORT bool GetSystemMemoryInfo(SystemMemoryInfoKB* meminfo);
// Parse the data found in /proc/<pid>/stat and return the sum of the
// CPU-related ticks. Returns -1 on parse error.
// Exposed for testing.
-BASE_EXPORT int ParseProcStatCPU(const std::string& input);
+BASE_EXPORT int ParseProcStatCPU(StringPiece input);
// 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
@@ -405,12 +405,14 @@ BASE_EXPORT extern const char kProcSelfExe[];
// Parses a string containing the contents of /proc/meminfo
// returns true on success or false for a parsing error
-BASE_EXPORT bool ParseProcMeminfo(const std::string& input,
+// Exposed for testing.
+BASE_EXPORT bool ParseProcMeminfo(StringPiece input,
SystemMemoryInfoKB* meminfo);
// Parses a string containing the contents of /proc/vmstat
// returns true on success or false for a parsing error
-BASE_EXPORT bool ParseProcVmstat(const std::string& input,
+// Exposed for testing.
+BASE_EXPORT bool ParseProcVmstat(StringPiece input,
SystemMemoryInfoKB* meminfo);
// Data from /proc/diskstats about system-wide disk I/O.
@@ -437,7 +439,7 @@ struct BASE_EXPORT SystemDiskInfo {
// Checks whether the candidate string is a valid disk name, [hsv]d[a-z]+
// for a generic disk or mmcblk[0-9]+ for the MMC case.
// Names of disk partitions (e.g. sda1) are not valid.
-BASE_EXPORT bool IsValidDiskName(const std::string& candidate);
+BASE_EXPORT bool IsValidDiskName(StringPiece candidate);
// Retrieves data from /proc/diskstats about system-wide disk I/O.
// Fills in the provided |diskinfo| structure. Returns true on success.
« no previous file with comments | « no previous file | base/process/process_metrics_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698