OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef COMPONENTS_SCHEDULER_BASE_DELAYED_TASK_DELEGATE_IMPL_H_ | |
6 #define COMPONENTS_SCHEDULER_BASE_DELAYED_TASK_DELEGATE_IMPL_H_ | |
7 | |
8 #include "base/callback.h" | |
9 #include "base/macros.h" | |
10 #include "base/memory/weak_ptr.h" | |
11 #include "components/scheduler/base/delayed_task_delegate.h" | |
12 #include "components/scheduler/scheduler_export.h" | |
13 | |
14 namespace scheduler { | |
15 class TaskQueueManagerDelegate; | |
16 | |
17 class SCHEDULER_EXPORT DelayedTaskDelegateImpl : public DelayedTaskDelegate { | |
18 public: | |
19 DelayedTaskDelegateImpl(TaskQueueManagerDelegate* delegate, | |
20 base::Closure do_work_closure); | |
21 | |
22 // TimeSource implementation: | |
23 base::TimeTicks CachedNow() override; | |
24 void InvalidateNowCache() override; | |
25 | |
26 protected: | |
27 // TimeSource protected implementation: | |
Sami
2015/11/17 10:31:06
TimeSource?
alex clarke (OOO till 29th)
2015/11/18 15:30:15
Done.
| |
28 bool BelongsToCurrentThread() const override; | |
29 void PostScheduleDelayedWorkTaskOnMainThread( | |
30 internal::TaskQueueImpl* queue, | |
31 base::TimeTicks delayed_run_time) override; | |
32 void ScheduleDoWork(base::TimeDelta delay) override; | |
33 | |
34 private: | |
35 TaskQueueManagerDelegate* delegate_; // NOT OWNED | |
36 base::TimeTicks cached_now_; | |
37 base::Closure do_work_closure_; | |
38 base::WeakPtrFactory<DelayedTaskDelegateImpl> weak_factory_; | |
39 | |
40 ~DelayedTaskDelegateImpl() override; | |
41 | |
42 DISALLOW_COPY_AND_ASSIGN(DelayedTaskDelegateImpl); | |
43 }; | |
44 | |
45 } // namespace scheduler | |
46 | |
47 #endif // COMPONENTS_SCHEDULER_BASE_DELAYED_TASK_DELEGATE_IMPL_H_ | |
OLD | NEW |