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

Side by Side Diff: chrome/browser/task_manager/sampling/task_manager_impl.cc

Issue 2573183002: Add process start time and CPU time columns to task manager (Closed)
Patch Set: Move ticks-Time and ticks-TimeDelta conversions to shared_sampler_win.cc Created 3 years, 12 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/task_manager/sampling/task_manager_impl.h" 5 #include "chrome/browser/task_manager/sampling/task_manager_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <unordered_map> 9 #include <unordered_map>
10 #include <unordered_set> 10 #include <unordered_set>
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 } 86 }
87 87
88 void TaskManagerImpl::KillTask(TaskId task_id) { 88 void TaskManagerImpl::KillTask(TaskId task_id) {
89 GetTaskByTaskId(task_id)->Kill(); 89 GetTaskByTaskId(task_id)->Kill();
90 } 90 }
91 91
92 double TaskManagerImpl::GetCpuUsage(TaskId task_id) const { 92 double TaskManagerImpl::GetCpuUsage(TaskId task_id) const {
93 return GetTaskGroupByTaskId(task_id)->cpu_usage(); 93 return GetTaskGroupByTaskId(task_id)->cpu_usage();
94 } 94 }
95 95
96 base::Time TaskManagerImpl::GetStartTime(TaskId task_id) const {
97 #if defined(OS_WIN)
98 return GetTaskGroupByTaskId(task_id)->start_time();
99 #else
afakhry 2017/01/09 21:03:43 Nit: Can you please add a NOTIMPLEMENTED(); here?
chengx 2017/01/10 00:39:27 Done.
100 return base::Time();
101 #endif
102 }
103
104 base::TimeDelta TaskManagerImpl::GetCpuTime(TaskId task_id) const {
105 #if defined(OS_WIN)
106 return GetTaskGroupByTaskId(task_id)->cpu_time();
107 #else
afakhry 2017/01/09 21:03:42 Here too?
chengx 2017/01/10 00:39:27 Done.
108 return base::TimeDelta();
109 #endif
110 }
111
96 int64_t TaskManagerImpl::GetPhysicalMemoryUsage(TaskId task_id) const { 112 int64_t TaskManagerImpl::GetPhysicalMemoryUsage(TaskId task_id) const {
97 return GetTaskGroupByTaskId(task_id)->physical_bytes(); 113 return GetTaskGroupByTaskId(task_id)->physical_bytes();
98 } 114 }
99 115
100 int64_t TaskManagerImpl::GetPrivateMemoryUsage(TaskId task_id) const { 116 int64_t TaskManagerImpl::GetPrivateMemoryUsage(TaskId task_id) const {
101 return GetTaskGroupByTaskId(task_id)->private_bytes(); 117 return GetTaskGroupByTaskId(task_id)->private_bytes();
102 } 118 }
103 119
104 int64_t TaskManagerImpl::GetSharedMemoryUsage(TaskId task_id) const { 120 int64_t TaskManagerImpl::GetSharedMemoryUsage(TaskId task_id) const {
105 return GetTaskGroupByTaskId(task_id)->shared_bytes(); 121 return GetTaskGroupByTaskId(task_id)->shared_bytes();
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 groups_itr.second->AreBackgroundCalculationsDone(); 556 groups_itr.second->AreBackgroundCalculationsDone();
541 } 557 }
542 if (are_all_processes_data_ready) { 558 if (are_all_processes_data_ready) {
543 NotifyObserversOnRefreshWithBackgroundCalculations(GetTaskIdsList()); 559 NotifyObserversOnRefreshWithBackgroundCalculations(GetTaskIdsList());
544 for (const auto& groups_itr : task_groups_by_proc_id_) 560 for (const auto& groups_itr : task_groups_by_proc_id_)
545 groups_itr.second->ClearCurrentBackgroundCalculationsFlags(); 561 groups_itr.second->ClearCurrentBackgroundCalculationsFlags();
546 } 562 }
547 } 563 }
548 564
549 } // namespace task_manager 565 } // namespace task_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698