| 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_TEST_LAZY_SCHEDULER_MESSAGE_LOOP_DELEGATE_FOR_TESTS
_H_ | 5 #ifndef COMPONENTS_SCHEDULER_TEST_LAZY_SCHEDULER_MESSAGE_LOOP_DELEGATE_FOR_TESTS
_H_ |
| 6 #define COMPONENTS_SCHEDULER_TEST_LAZY_SCHEDULER_MESSAGE_LOOP_DELEGATE_FOR_TESTS
_H_ | 6 #define COMPONENTS_SCHEDULER_TEST_LAZY_SCHEDULER_MESSAGE_LOOP_DELEGATE_FOR_TESTS
_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/time/tick_clock.h" | 10 #include "base/time/tick_clock.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 void RestoreDefaultTaskRunner() override; | 29 void RestoreDefaultTaskRunner() override; |
| 30 bool PostDelayedTask(const tracked_objects::Location& from_here, | 30 bool PostDelayedTask(const tracked_objects::Location& from_here, |
| 31 const base::Closure& task, | 31 const base::Closure& task, |
| 32 base::TimeDelta delay) override; | 32 base::TimeDelta delay) override; |
| 33 bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, | 33 bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, |
| 34 const base::Closure& task, | 34 const base::Closure& task, |
| 35 base::TimeDelta delay) override; | 35 base::TimeDelta delay) override; |
| 36 bool RunsTasksOnCurrentThread() const override; | 36 bool RunsTasksOnCurrentThread() const override; |
| 37 bool IsNested() const override; | 37 bool IsNested() const override; |
| 38 base::TimeTicks NowTicks() override; | 38 base::TimeTicks NowTicks() override; |
| 39 void OnNoMoreImmediateWork() override; | |
| 40 double CurrentTimeSeconds() const override; | |
| 41 | 39 |
| 42 private: | 40 private: |
| 43 LazySchedulerMessageLoopDelegateForTests(); | 41 LazySchedulerMessageLoopDelegateForTests(); |
| 44 ~LazySchedulerMessageLoopDelegateForTests() override; | 42 ~LazySchedulerMessageLoopDelegateForTests() override; |
| 45 | 43 |
| 46 bool HasMessageLoop() const; | 44 bool HasMessageLoop() const; |
| 47 base::MessageLoop* EnsureMessageLoop() const; | 45 base::MessageLoop* EnsureMessageLoop() const; |
| 48 | 46 |
| 49 mutable base::MessageLoop* message_loop_; | 47 mutable base::MessageLoop* message_loop_; |
| 50 base::PlatformThreadId thread_id_; | 48 base::PlatformThreadId thread_id_; |
| 51 | 49 |
| 52 // A task runner which hasn't yet been overridden in the message loop. | 50 // A task runner which hasn't yet been overridden in the message loop. |
| 53 mutable scoped_refptr<base::SingleThreadTaskRunner> pending_task_runner_; | 51 mutable scoped_refptr<base::SingleThreadTaskRunner> pending_task_runner_; |
| 54 mutable scoped_refptr<base::SingleThreadTaskRunner> original_task_runner_; | 52 mutable scoped_refptr<base::SingleThreadTaskRunner> original_task_runner_; |
| 55 scoped_ptr<base::TickClock> time_source_; | 53 scoped_ptr<base::TickClock> time_source_; |
| 56 | 54 |
| 57 DISALLOW_COPY_AND_ASSIGN(LazySchedulerMessageLoopDelegateForTests); | 55 DISALLOW_COPY_AND_ASSIGN(LazySchedulerMessageLoopDelegateForTests); |
| 58 }; | 56 }; |
| 59 | 57 |
| 60 } // namespace scheduler | 58 } // namespace scheduler |
| 61 | 59 |
| 62 #endif // COMPONENTS_SCHEDULER_TEST_LAZY_SCHEDULER_MESSAGE_LOOP_DELEGATE_FOR_TE
STS_H_ | 60 #endif // COMPONENTS_SCHEDULER_TEST_LAZY_SCHEDULER_MESSAGE_LOOP_DELEGATE_FOR_TE
STS_H_ |
| OLD | NEW |