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

Unified Diff: chrome/browser/task_manager/sampling/task_group.cc

Issue 2573183002: Add process start time and CPU time columns to task manager (Closed)
Patch Set: Add TODO comment for a bug, which will be addressed in another CL. Created 4 years 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
Index: chrome/browser/task_manager/sampling/task_group.cc
diff --git a/chrome/browser/task_manager/sampling/task_group.cc b/chrome/browser/task_manager/sampling/task_group.cc
index 5e36d732e9aa5ba72c47acae6b1f78d2347114f9..2f86e1171513b0d8fc49b31de8b7cab941511836 100644
--- a/chrome/browser/task_manager/sampling/task_group.cc
+++ b/chrome/browser/task_manager/sampling/task_group.cc
@@ -25,6 +25,8 @@ const int kBackgroundRefreshTypesMask =
REFRESH_TYPE_CPU |
REFRESH_TYPE_MEMORY |
REFRESH_TYPE_IDLE_WAKEUPS |
+ REFRESH_TYPE_START_TIME |
+ REFRESH_TYPE_CPU_TIME |
#if defined(OS_LINUX)
REFRESH_TYPE_FD_COUNT |
#endif // defined(OS_LINUX)
@@ -76,6 +78,8 @@ TaskGroup::TaskGroup(
expected_on_bg_done_flags_(kBackgroundRefreshTypesMask),
current_on_bg_done_flags_(0),
cpu_usage_(0.0),
+ start_time_(0),
+ cpu_time_(0),
gpu_memory_(-1),
per_process_network_usage_(-1),
#if defined(OS_WIN)
@@ -115,6 +119,10 @@ TaskGroup::TaskGroup(
process_id_, base::Bind(&TaskGroup::OnIdleWakeupsRefreshDone,
weak_ptr_factory_.GetWeakPtr()),
base::Bind(&TaskGroup::OnPhysicalMemoryUsageRefreshDone,
+ weak_ptr_factory_.GetWeakPtr()),
+ base::Bind(&TaskGroup::OnStartTimeRefreshDone,
+ weak_ptr_factory_.GetWeakPtr()),
+ base::Bind(&TaskGroup::OnCpuTimeRefreshDone,
weak_ptr_factory_.GetWeakPtr()));
}
@@ -253,6 +261,20 @@ void TaskGroup::OnCpuRefreshDone(double cpu_usage) {
OnBackgroundRefreshTypeFinished(REFRESH_TYPE_CPU);
}
+void TaskGroup::OnStartTimeRefreshDone(uint64_t start_time) {
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+
+ start_time_ = start_time;
+ OnBackgroundRefreshTypeFinished(REFRESH_TYPE_START_TIME);
+}
+
+void TaskGroup::OnCpuTimeRefreshDone(uint64_t cpu_time) {
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+
+ cpu_time_ = cpu_time;
+ OnBackgroundRefreshTypeFinished(REFRESH_TYPE_CPU_TIME);
+}
+
void TaskGroup::OnPhysicalMemoryUsageRefreshDone(int64_t physical_bytes) {
#if defined(OS_WIN)
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);

Powered by Google App Engine
This is Rietveld 408576698