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_IDLE_HELPER_H_ | 5 #ifndef COMPONENTS_SCHEDULER_CHILD_IDLE_HELPER_H_ |
6 #define COMPONENTS_SCHEDULER_CHILD_IDLE_HELPER_H_ | 6 #define COMPONENTS_SCHEDULER_CHILD_IDLE_HELPER_H_ |
7 | 7 |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "components/scheduler/base/cancelable_closure_holder.h" | 9 #include "components/scheduler/base/cancelable_closure_holder.h" |
10 #include "components/scheduler/base/task_queue_selector.h" | 10 #include "components/scheduler/base/task_queue_selector.h" |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 | 143 |
144 IdlePeriodState idle_period_state() const; | 144 IdlePeriodState idle_period_state() const; |
145 base::TimeTicks idle_period_deadline() const; | 145 base::TimeTicks idle_period_deadline() const; |
146 | 146 |
147 void TraceIdleIdleTaskStart(); | 147 void TraceIdleIdleTaskStart(); |
148 void TraceIdleIdleTaskEnd(); | 148 void TraceIdleIdleTaskEnd(); |
149 | 149 |
150 private: | 150 private: |
151 void TraceEventIdlePeriodStateChange(IdlePeriodState new_state, | 151 void TraceEventIdlePeriodStateChange(IdlePeriodState new_state, |
152 bool new_running_idle_task, | 152 bool new_running_idle_task, |
153 base::TraceTicks new_deadline, | 153 base::TimeTicks new_deadline, |
154 base::TraceTicks optional_now); | 154 base::TimeTicks optional_now); |
155 | 155 |
156 SchedulerHelper* helper_; // NOT OWNED | 156 SchedulerHelper* helper_; // NOT OWNED |
157 Delegate* delegate_; // NOT OWNED | 157 Delegate* delegate_; // NOT OWNED |
158 | 158 |
159 IdlePeriodState idle_period_state_; | 159 IdlePeriodState idle_period_state_; |
160 base::TimeTicks idle_period_deadline_; | 160 base::TimeTicks idle_period_deadline_; |
161 | 161 |
162 base::TraceTicks idle_period_deadline_for_tracing_; | 162 base::TimeTicks last_idle_task_trace_time_; |
163 base::TraceTicks last_idle_task_trace_time_; | |
164 bool idle_period_trace_event_started_; | 163 bool idle_period_trace_event_started_; |
165 bool running_idle_task_for_tracing_; | 164 bool running_idle_task_for_tracing_; |
166 const char* tracing_category_; | 165 const char* tracing_category_; |
167 const char* disabled_by_default_tracing_category_; | 166 const char* disabled_by_default_tracing_category_; |
168 const char* idle_period_tracing_name_; | 167 const char* idle_period_tracing_name_; |
169 | 168 |
170 DISALLOW_COPY_AND_ASSIGN(State); | 169 DISALLOW_COPY_AND_ASSIGN(State); |
171 }; | 170 }; |
172 | 171 |
173 // The minimum duration of an idle period. | 172 // The minimum duration of an idle period. |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 | 211 |
213 base::WeakPtr<IdleHelper> weak_idle_helper_ptr_; | 212 base::WeakPtr<IdleHelper> weak_idle_helper_ptr_; |
214 base::WeakPtrFactory<IdleHelper> weak_factory_; | 213 base::WeakPtrFactory<IdleHelper> weak_factory_; |
215 | 214 |
216 DISALLOW_COPY_AND_ASSIGN(IdleHelper); | 215 DISALLOW_COPY_AND_ASSIGN(IdleHelper); |
217 }; | 216 }; |
218 | 217 |
219 } // namespace scheduler | 218 } // namespace scheduler |
220 | 219 |
221 #endif // COMPONENTS_SCHEDULER_CHILD_IDLE_HELPER_H_ | 220 #endif // COMPONENTS_SCHEDULER_CHILD_IDLE_HELPER_H_ |
OLD | NEW |