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 CONTENT_CHILD_SCHEDULER_SCHEDULER_HELPER_H_ | 5 #ifndef CONTENT_CHILD_SCHEDULER_SCHEDULER_HELPER_H_ |
6 #define CONTENT_CHILD_SCHEDULER_SCHEDULER_HELPER_H_ | 6 #define CONTENT_CHILD_SCHEDULER_SCHEDULER_HELPER_H_ |
7 | 7 |
8 #include "cc/test/test_now_source.h" | 8 #include "cc/test/test_now_source.h" |
9 #include "content/child/scheduler/cancelable_closure_holder.h" | 9 #include "content/child/scheduler/cancelable_closure_holder.h" |
10 #include "content/child/scheduler/single_thread_idle_task_runner.h" | 10 #include "content/child/scheduler/single_thread_idle_task_runner.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 SchedulerHelperDelegate(); | 24 SchedulerHelperDelegate(); |
25 virtual ~SchedulerHelperDelegate(); | 25 virtual ~SchedulerHelperDelegate(); |
26 | 26 |
27 // If it's ok to enter a Long Idle period, return true. Otherwise return | 27 // If it's ok to enter a Long Idle period, return true. Otherwise return |
28 // false and set next_long_idle_period_delay_out so we know when to try | 28 // false and set next_long_idle_period_delay_out so we know when to try |
29 // again. | 29 // again. |
30 virtual bool CanEnterLongIdlePeriod( | 30 virtual bool CanEnterLongIdlePeriod( |
31 base::TimeTicks now, | 31 base::TimeTicks now, |
32 base::TimeDelta* next_long_idle_period_delay_out) = 0; | 32 base::TimeDelta* next_long_idle_period_delay_out) = 0; |
33 | 33 |
| 34 // Signals that the Long Idle Period hasn't started yet because the system |
| 35 // isn't quiescent. |
| 36 virtual void IsNotQuiescent() = 0; |
| 37 |
34 private: | 38 private: |
35 DISALLOW_COPY_AND_ASSIGN(SchedulerHelperDelegate); | 39 DISALLOW_COPY_AND_ASSIGN(SchedulerHelperDelegate); |
36 }; | 40 }; |
37 | 41 |
38 // NOTE |total_task_queue_count| must be >= TASK_QUEUE_COUNT. | 42 // NOTE |total_task_queue_count| must be >= TASK_QUEUE_COUNT. |
39 // Category strings must have application lifetime (statics or | 43 // Category strings must have application lifetime (statics or |
40 // literals). They may not include " chars. | 44 // literals). They may not include " chars. |
41 SchedulerHelper( | 45 SchedulerHelper( |
42 scoped_refptr<NestableSingleThreadTaskRunner> main_task_runner, | 46 scoped_refptr<NestableSingleThreadTaskRunner> main_task_runner, |
43 SchedulerHelperDelegate* scheduler_helper_delegate, | 47 SchedulerHelperDelegate* scheduler_helper_delegate, |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 | 199 |
196 base::WeakPtr<SchedulerHelper> weak_scheduler_ptr_; | 200 base::WeakPtr<SchedulerHelper> weak_scheduler_ptr_; |
197 base::WeakPtrFactory<SchedulerHelper> weak_factory_; | 201 base::WeakPtrFactory<SchedulerHelper> weak_factory_; |
198 | 202 |
199 DISALLOW_COPY_AND_ASSIGN(SchedulerHelper); | 203 DISALLOW_COPY_AND_ASSIGN(SchedulerHelper); |
200 }; | 204 }; |
201 | 205 |
202 } // namespace content | 206 } // namespace content |
203 | 207 |
204 #endif // CONTENT_CHILD_SCHEDULER_SCHEDULER_HELPER_H_ | 208 #endif // CONTENT_CHILD_SCHEDULER_SCHEDULER_HELPER_H_ |
OLD | NEW |