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 #ifndef CONTENT_CHILD_SCHEDULER_SINGLE_THREAD_IDLE_TASK_RUNNER_H_ | 5 #ifndef COMPONENTS_SCHEDULER_CHILD_SINGLE_THREAD_IDLE_TASK_RUNNER_H_ |
6 #define CONTENT_CHILD_SCHEDULER_SINGLE_THREAD_IDLE_TASK_RUNNER_H_ | 6 #define COMPONENTS_SCHEDULER_CHILD_SINGLE_THREAD_IDLE_TASK_RUNNER_H_ |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "base/single_thread_task_runner.h" | 11 #include "base/single_thread_task_runner.h" |
12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
13 | 13 |
14 namespace content { | 14 namespace scheduler { |
15 | 15 |
16 // A SingleThreadIdleTaskRunner is a task runner for running idle tasks. Idle | 16 // A SingleThreadIdleTaskRunner is a task runner for running idle tasks. Idle |
17 // tasks have an unbound argument which is bound to a deadline | 17 // tasks have an unbound argument which is bound to a deadline |
18 // (in base::TimeTicks) when they are run. The idle task is expected to | 18 // (in base::TimeTicks) when they are run. The idle task is expected to |
19 // complete by this deadline. | 19 // complete by this deadline. |
20 class SingleThreadIdleTaskRunner | 20 class SingleThreadIdleTaskRunner |
21 : public base::RefCountedThreadSafe<SingleThreadIdleTaskRunner> { | 21 : public base::RefCountedThreadSafe<SingleThreadIdleTaskRunner> { |
22 public: | 22 public: |
23 typedef base::Callback<void(base::TimeTicks)> IdleTask; | 23 typedef base::Callback<void(base::TimeTicks)> IdleTask; |
24 | 24 |
(...skipping 28 matching lines...) Expand all Loading... |
53 | 53 |
54 scoped_refptr<base::SingleThreadTaskRunner> idle_priority_task_runner_; | 54 scoped_refptr<base::SingleThreadTaskRunner> idle_priority_task_runner_; |
55 scoped_refptr<base::SingleThreadTaskRunner> after_wakeup_task_runner_; | 55 scoped_refptr<base::SingleThreadTaskRunner> after_wakeup_task_runner_; |
56 base::Callback<void(base::TimeTicks*)> deadline_supplier_; | 56 base::Callback<void(base::TimeTicks*)> deadline_supplier_; |
57 const char* tracing_category_; | 57 const char* tracing_category_; |
58 base::WeakPtr<SingleThreadIdleTaskRunner> weak_scheduler_ptr_; | 58 base::WeakPtr<SingleThreadIdleTaskRunner> weak_scheduler_ptr_; |
59 base::WeakPtrFactory<SingleThreadIdleTaskRunner> weak_factory_; | 59 base::WeakPtrFactory<SingleThreadIdleTaskRunner> weak_factory_; |
60 DISALLOW_COPY_AND_ASSIGN(SingleThreadIdleTaskRunner); | 60 DISALLOW_COPY_AND_ASSIGN(SingleThreadIdleTaskRunner); |
61 }; | 61 }; |
62 | 62 |
63 } // namespace content | 63 } // namespace scheduler |
64 | 64 |
65 #endif // CONTENT_CHILD_SCHEDULER_SINGLE_THREAD_IDLE_TASK_RUNNER_H_ | 65 #endif // COMPONENTS_SCHEDULER_CHILD_SINGLE_THREAD_IDLE_TASK_RUNNER_H_ |
OLD | NEW |