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

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: Fix nits and conflicts. Created 3 years, 11 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
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 3a480153ba8186f4f41b0e9d81b3c79ac592b284..a7a0d11116ec0b15b4f361873cfdc146174b294e 100644
--- a/chrome/browser/task_manager/sampling/task_group.cc
+++ b/chrome/browser/task_manager/sampling/task_group.cc
@@ -24,9 +24,10 @@ namespace {
// A mask for the refresh types that are done in the background thread.
const int kBackgroundRefreshTypesMask =
- REFRESH_TYPE_CPU |
- REFRESH_TYPE_MEMORY |
- REFRESH_TYPE_IDLE_WAKEUPS |
+ REFRESH_TYPE_CPU | REFRESH_TYPE_MEMORY | REFRESH_TYPE_IDLE_WAKEUPS |
+#if defined(OS_WIN)
+ REFRESH_TYPE_START_TIME | REFRESH_TYPE_CPU_TIME |
+#endif // defined(OS_WIN)
#if defined(OS_LINUX)
REFRESH_TYPE_FD_COUNT |
#endif // defined(OS_LINUX)
@@ -117,8 +118,12 @@ TaskGroup::TaskGroup(
shared_sampler_->RegisterCallbacks(
process_id_, base::Bind(&TaskGroup::OnIdleWakeupsRefreshDone,
weak_ptr_factory_.GetWeakPtr()),
- base::Bind(&TaskGroup::OnPhysicalMemoryUsageRefreshDone,
- 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()));
}
TaskGroup::~TaskGroup() {
@@ -265,6 +270,20 @@ void TaskGroup::OnCpuRefreshDone(double cpu_usage) {
OnBackgroundRefreshTypeFinished(REFRESH_TYPE_CPU);
}
+void TaskGroup::OnStartTimeRefreshDone(base::Time start_time) {
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+
+ start_time_ = start_time;
+ OnBackgroundRefreshTypeFinished(REFRESH_TYPE_START_TIME);
+}
+
+void TaskGroup::OnCpuTimeRefreshDone(base::TimeDelta 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);
« no previous file with comments | « chrome/browser/task_manager/sampling/task_group.h ('k') | chrome/browser/task_manager/sampling/task_manager_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698