| 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);
|
|
|