Commit a0d051ed authored by thestig's avatar thestig Committed by Commit bot

Cleanup bits of base::ProcessMetrics.

Review URL: https://codereview.chromium.org/549753002

Cr-Commit-Position: refs/heads/master@{#293791}
parent 8c59383c
...@@ -53,7 +53,7 @@ double ProcessMetrics::GetPlatformIndependentCPUUsage() { ...@@ -53,7 +53,7 @@ double ProcessMetrics::GetPlatformIndependentCPUUsage() {
#if !defined(OS_MACOSX) #if !defined(OS_MACOSX)
int ProcessMetrics::GetIdleWakeupsPerSecond() { int ProcessMetrics::GetIdleWakeupsPerSecond() {
NOTIMPLEMENTED(); // http://crbug.com/20488 NOTIMPLEMENTED(); // http://crbug.com/120488
return 0; return 0;
} }
#endif // !defined(OS_MACOSX) #endif // !defined(OS_MACOSX)
......
...@@ -202,9 +202,11 @@ class BASE_EXPORT ProcessMetrics { ...@@ -202,9 +202,11 @@ class BASE_EXPORT ProcessMetrics {
TimeTicks last_cpu_time_; TimeTicks last_cpu_time_;
int64 last_system_time_; int64 last_system_time_;
#if defined(OS_MACOSX)
// Same thing for idle wakeups. // Same thing for idle wakeups.
TimeTicks last_idle_wakeups_time_; TimeTicks last_idle_wakeups_time_;
int64 last_absolute_idle_wakeups_; uint64 last_absolute_idle_wakeups_;
#endif
#if !defined(OS_IOS) #if !defined(OS_IOS)
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
...@@ -320,7 +322,7 @@ struct BASE_EXPORT SystemDiskInfo { ...@@ -320,7 +322,7 @@ struct BASE_EXPORT SystemDiskInfo {
uint64 weighted_io_time; uint64 weighted_io_time;
}; };
// Checks whether the candidate string is a valid disk name, [sh]d[a-z]+ // 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. // for a generic disk or mmcblk[0-9]+ for the MMC case.
// Names of disk partitions (e.g. sda1) are not valid. // Names of disk partitions (e.g. sda1) are not valid.
BASE_EXPORT bool IsValidDiskName(const std::string& candidate); BASE_EXPORT bool IsValidDiskName(const std::string& candidate);
......
This diff is collapsed.
...@@ -312,9 +312,10 @@ int ProcessMetrics::GetIdleWakeupsPerSecond() { ...@@ -312,9 +312,10 @@ int ProcessMetrics::GetIdleWakeupsPerSecond() {
int64 wakeups_delta = absolute_idle_wakeups - last_absolute_idle_wakeups_; int64 wakeups_delta = absolute_idle_wakeups - last_absolute_idle_wakeups_;
int64 time_delta = (time - last_idle_wakeups_time_).InMicroseconds(); int64 time_delta = (time - last_idle_wakeups_time_).InMicroseconds();
DCHECK_NE(0U, time_delta); if (time_delta == 0) {
if (time_delta == 0) NOTREACHED();
return 0; return 0;
}
last_idle_wakeups_time_ = time; last_idle_wakeups_time_ = time;
last_absolute_idle_wakeups_ = absolute_idle_wakeups; last_absolute_idle_wakeups_ = absolute_idle_wakeups;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment