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

Unified Diff: base/process/process_metrics.h

Issue 23155002: Implement ToValue() for SystemMetrics, SystemMemoryInfoKB, DiskInfo, and SwapInfo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@meminfo
Patch Set: change Value* AsValue() to scoped_ptr<Value> ToValue() Created 7 years, 3 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.cc » ('j') | base/process/process_metrics.cc » ('J')
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 0131579d63152c3675a46730f13010e8788f65a0..f6b225fa94fab2603fdcc51ab425e9dadcc90a4e 100644
--- a/base/process/process_metrics.h
+++ b/base/process/process_metrics.h
@@ -15,6 +15,7 @@
#include "base/gtest_prod_util.h"
#include "base/process/process_handle.h"
#include "base/time/time.h"
+#include "base/values.h"
#if defined(OS_MACOSX)
#include <mach/mach.h>
@@ -243,6 +244,9 @@ BASE_EXPORT extern const char kProcSelfExe[];
struct BASE_EXPORT SystemMemoryInfoKB {
SystemMemoryInfoKB();
+ // Serializes the platform specific fields to value.
+ scoped_ptr<Value> ToValue() const;
+
int total;
int free;
int buffers;
@@ -279,6 +283,9 @@ BASE_EXPORT bool GetSystemMemoryInfo(SystemMemoryInfoKB* meminfo);
struct BASE_EXPORT SystemDiskInfo {
SystemDiskInfo();
+ // Serializes the platform specific fields to value.
+ scoped_ptr<Value> ToValue() const;
+
uint64 reads;
uint64 reads_merged;
uint64 sectors_read;
@@ -313,6 +320,9 @@ struct BASE_EXPORT SwapInfo {
mem_used_total(0) {
}
+ // Serializes the platform specific fields to value.
+ scoped_ptr<Value> ToValue() const;
+
uint64 num_reads;
uint64 num_writes;
uint64 compr_data_size;
@@ -334,6 +344,9 @@ class SystemMetrics {
static SystemMetrics Sample();
+ // Serializes the system metrics to value.
+ scoped_ptr<Value> ToValue() const;
+
private:
FRIEND_TEST_ALL_PREFIXES(SystemMetricsTest, SystemMetrics);
« no previous file with comments | « no previous file | base/process/process_metrics.cc » ('j') | base/process/process_metrics.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698