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 THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_TASK_QUEUE_THROTTL
ER_H_ | 5 #ifndef THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_TASK_QUEUE_THROTTL
ER_H_ |
6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_TASK_QUEUE_THROTTL
ER_H_ | 6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_TASK_QUEUE_THROTTL
ER_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <unordered_map> | 9 #include <unordered_map> |
10 | 10 |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 CPUTimeBudgetPool* CreateCPUTimeBudgetPool(const char* name); | 144 CPUTimeBudgetPool* CreateCPUTimeBudgetPool(const char* name); |
145 WakeUpBudgetPool* CreateWakeUpBudgetPool(const char* name); | 145 WakeUpBudgetPool* CreateWakeUpBudgetPool(const char* name); |
146 | 146 |
147 // Accounts for given task for cpu-based throttling needs. | 147 // Accounts for given task for cpu-based throttling needs. |
148 void OnTaskRunTimeReported(TaskQueue* task_queue, | 148 void OnTaskRunTimeReported(TaskQueue* task_queue, |
149 base::TimeTicks start_time, | 149 base::TimeTicks start_time, |
150 base::TimeTicks end_time); | 150 base::TimeTicks end_time); |
151 | 151 |
152 void AsValueInto(base::trace_event::TracedValue* state, | 152 void AsValueInto(base::trace_event::TracedValue* state, |
153 base::TimeTicks now) const; | 153 base::TimeTicks now) const; |
| 154 |
154 private: | 155 private: |
155 struct Metadata { | 156 struct Metadata { |
156 Metadata() : throttling_ref_count(0) {} | 157 Metadata() : throttling_ref_count(0) {} |
157 | 158 |
158 size_t throttling_ref_count; | 159 size_t throttling_ref_count; |
159 | 160 |
160 std::unordered_set<BudgetPool*> budget_pools; | 161 std::unordered_set<BudgetPool*> budget_pools; |
161 }; | 162 }; |
162 using TaskQueueMap = std::unordered_map<TaskQueue*, Metadata>; | 163 using TaskQueueMap = std::unordered_map<TaskQueue*, Metadata>; |
163 | 164 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 | 204 |
204 base::WeakPtrFactory<TaskQueueThrottler> weak_factory_; | 205 base::WeakPtrFactory<TaskQueueThrottler> weak_factory_; |
205 | 206 |
206 DISALLOW_COPY_AND_ASSIGN(TaskQueueThrottler); | 207 DISALLOW_COPY_AND_ASSIGN(TaskQueueThrottler); |
207 }; | 208 }; |
208 | 209 |
209 } // namespace scheduler | 210 } // namespace scheduler |
210 } // namespace blink | 211 } // namespace blink |
211 | 212 |
212 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_TASK_QUEUE_THRO
TTLER_H_ | 213 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_TASK_QUEUE_THRO
TTLER_H_ |
OLD | NEW |