| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/scheduler/child/task_queue_manager.h" | 5 #include "components/scheduler/child/task_queue_manager.h" |
| 6 | 6 |
| 7 #include <queue> | 7 #include <queue> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 722 base::MessageLoop::current()->RemoveTaskObserver(task_observer); | 722 base::MessageLoop::current()->RemoveTaskObserver(task_observer); |
| 723 task_observers_.RemoveObserver(task_observer); | 723 task_observers_.RemoveObserver(task_observer); |
| 724 } | 724 } |
| 725 | 725 |
| 726 void TaskQueueManager::SetTimeSourceForTesting( | 726 void TaskQueueManager::SetTimeSourceForTesting( |
| 727 scoped_ptr<TimeSource> time_source) { | 727 scoped_ptr<TimeSource> time_source) { |
| 728 DCHECK(main_thread_checker_.CalledOnValidThread()); | 728 DCHECK(main_thread_checker_.CalledOnValidThread()); |
| 729 time_source_ = time_source.Pass(); | 729 time_source_ = time_source.Pass(); |
| 730 } | 730 } |
| 731 | 731 |
| 732 TimeSource* TaskQueueManager::GetTimeSourceForTesting() { |
| 733 DCHECK(main_thread_checker_.CalledOnValidThread()); |
| 734 return time_source_.get(); |
| 735 } |
| 736 |
| 732 uint64 TaskQueueManager::GetAndClearTaskWasRunOnQueueBitmap() { | 737 uint64 TaskQueueManager::GetAndClearTaskWasRunOnQueueBitmap() { |
| 733 uint64 bitmap = task_was_run_bitmap_; | 738 uint64 bitmap = task_was_run_bitmap_; |
| 734 task_was_run_bitmap_ = 0; | 739 task_was_run_bitmap_ = 0; |
| 735 return bitmap; | 740 return bitmap; |
| 736 } | 741 } |
| 737 | 742 |
| 738 base::TimeTicks TaskQueueManager::Now() const { | 743 base::TimeTicks TaskQueueManager::Now() const { |
| 739 return time_source_->Now(); | 744 return time_source_->Now(); |
| 740 } | 745 } |
| 741 | 746 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 786 return nullptr; | 791 return nullptr; |
| 787 } | 792 } |
| 788 } | 793 } |
| 789 | 794 |
| 790 void TaskQueueManager::OnTaskQueueEnabled() { | 795 void TaskQueueManager::OnTaskQueueEnabled() { |
| 791 DCHECK(main_thread_checker_.CalledOnValidThread()); | 796 DCHECK(main_thread_checker_.CalledOnValidThread()); |
| 792 MaybePostDoWorkOnMainRunner(); | 797 MaybePostDoWorkOnMainRunner(); |
| 793 } | 798 } |
| 794 | 799 |
| 795 } // namespace scheduler | 800 } // namespace scheduler |
| OLD | NEW |