| OLD | NEW |
| 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 21 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 namespace { | 33 namespace { |
| 34 | 34 |
| 35 scoped_refptr<base::SequencedTaskRunner> GetBlockingPoolRunner() { | 35 scoped_refptr<base::SequencedTaskRunner> GetBlockingPoolRunner() { |
| 36 base::SequencedWorkerPool* blocking_pool = | 36 base::SequencedWorkerPool* blocking_pool = |
| 37 content::BrowserThread::GetBlockingPool(); | 37 content::BrowserThread::GetBlockingPool(); |
| 38 return blocking_pool->GetSequencedTaskRunner( | 38 return blocking_pool->GetSequencedTaskRunner( |
| 39 blocking_pool->GetSequenceToken()); | 39 blocking_pool->GetSequenceToken()); |
| 40 } | 40 } |
| 41 | 41 |
| 42 base::LazyInstance<TaskManagerImpl> lazy_task_manager_instance = | 42 base::LazyInstance<TaskManagerImpl>::DestructorAtExit |
| 43 LAZY_INSTANCE_INITIALIZER; | 43 lazy_task_manager_instance = LAZY_INSTANCE_INITIALIZER; |
| 44 | 44 |
| 45 } // namespace | 45 } // namespace |
| 46 | 46 |
| 47 TaskManagerImpl::TaskManagerImpl() | 47 TaskManagerImpl::TaskManagerImpl() |
| 48 : on_background_data_ready_callback_( | 48 : on_background_data_ready_callback_( |
| 49 base::Bind(&TaskManagerImpl::OnTaskGroupBackgroundCalculationsDone, | 49 base::Bind(&TaskManagerImpl::OnTaskGroupBackgroundCalculationsDone, |
| 50 base::Unretained(this))), | 50 base::Unretained(this))), |
| 51 blocking_pool_runner_(GetBlockingPoolRunner()), | 51 blocking_pool_runner_(GetBlockingPoolRunner()), |
| 52 shared_sampler_(new SharedSampler(blocking_pool_runner_)), | 52 shared_sampler_(new SharedSampler(blocking_pool_runner_)), |
| 53 is_running_(false) { | 53 is_running_(false) { |
| (...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 groups_itr.second->AreBackgroundCalculationsDone(); | 568 groups_itr.second->AreBackgroundCalculationsDone(); |
| 569 } | 569 } |
| 570 if (are_all_processes_data_ready) { | 570 if (are_all_processes_data_ready) { |
| 571 NotifyObserversOnRefreshWithBackgroundCalculations(GetTaskIdsList()); | 571 NotifyObserversOnRefreshWithBackgroundCalculations(GetTaskIdsList()); |
| 572 for (const auto& groups_itr : task_groups_by_proc_id_) | 572 for (const auto& groups_itr : task_groups_by_proc_id_) |
| 573 groups_itr.second->ClearCurrentBackgroundCalculationsFlags(); | 573 groups_itr.second->ClearCurrentBackgroundCalculationsFlags(); |
| 574 } | 574 } |
| 575 } | 575 } |
| 576 | 576 |
| 577 } // namespace task_manager | 577 } // namespace task_manager |
| OLD | NEW |