| 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 #ifndef COMPONENTS_SCHEDULER_CHILD_VIRTUAL_TIME_TQM_DELEGATE_H_ | 5 #ifndef COMPONENTS_SCHEDULER_CHILD_VIRTUAL_TIME_TQM_DELEGATE_H_ |
| 6 #define COMPONENTS_SCHEDULER_CHILD_VIRTUAL_TIME_TQM_DELEGATE_H_ | 6 #define COMPONENTS_SCHEDULER_CHILD_VIRTUAL_TIME_TQM_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 bool PostDelayedTask(const tracked_objects::Location& from_here, | 29 bool PostDelayedTask(const tracked_objects::Location& from_here, |
| 30 const base::Closure& task, | 30 const base::Closure& task, |
| 31 base::TimeDelta delay) override; | 31 base::TimeDelta delay) override; |
| 32 bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, | 32 bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, |
| 33 const base::Closure& task, | 33 const base::Closure& task, |
| 34 base::TimeDelta delay) override; | 34 base::TimeDelta delay) override; |
| 35 bool RunsTasksOnCurrentThread() const override; | 35 bool RunsTasksOnCurrentThread() const override; |
| 36 bool IsNested() const override; | 36 bool IsNested() const override; |
| 37 base::TimeTicks NowTicks() override; | 37 base::TimeTicks NowTicks() override; |
| 38 void OnNoMoreImmediateWork() override; | 38 void OnNoMoreImmediateWork() override; |
| 39 double CurrentTimeSeconds() const override; |
| 39 | 40 |
| 40 protected: | 41 protected: |
| 41 ~VirtualTimeTqmDelegate() override; | 42 ~VirtualTimeTqmDelegate() override; |
| 42 | 43 |
| 43 private: | 44 private: |
| 44 explicit VirtualTimeTqmDelegate(base::MessageLoop* message_loop, | 45 explicit VirtualTimeTqmDelegate(base::MessageLoop* message_loop, |
| 45 base::TimeTicks initial_no); | 46 base::TimeTicks initial_no); |
| 46 | 47 |
| 47 void AdvancedTimeTo(base::TimeTicks now); | 48 void AdvancedTimeTo(base::TimeTicks now); |
| 48 | 49 |
| 49 typedef std::multimap<base::TimeTicks, base::Closure> DelayedWakeupMultimap; | 50 typedef std::multimap<base::TimeTicks, base::Closure> DelayedWakeupMultimap; |
| 50 | 51 |
| 51 DelayedWakeupMultimap delayed_wakeup_multimap_; | 52 DelayedWakeupMultimap delayed_wakeup_multimap_; |
| 52 | 53 |
| 53 // Not owned. | 54 // Not owned. |
| 54 base::MessageLoop* message_loop_; | 55 base::MessageLoop* message_loop_; |
| 55 scoped_refptr<SingleThreadTaskRunner> message_loop_task_runner_; | 56 scoped_refptr<SingleThreadTaskRunner> message_loop_task_runner_; |
| 56 base::TimeTicks now_; | 57 base::TimeTicks now_; |
| 57 | 58 |
| 58 DISALLOW_COPY_AND_ASSIGN(VirtualTimeTqmDelegate); | 59 DISALLOW_COPY_AND_ASSIGN(VirtualTimeTqmDelegate); |
| 59 }; | 60 }; |
| 60 | 61 |
| 61 } // namespace scheduler | 62 } // namespace scheduler |
| 62 | 63 |
| 63 #endif // COMPONENTS_SCHEDULER_CHILD_VIRTUAL_TIME_TQM_DELEGATE_H_ | 64 #endif // COMPONENTS_SCHEDULER_CHILD_VIRTUAL_TIME_TQM_DELEGATE_H_ |
| OLD | NEW |