Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Side by Side Diff: third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler.h

Issue 2393193003: Revert "[scheduler] Throttle background frames with 1% CPU limit" (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_THROTTLING_HELPER_ H_ 5 #ifndef THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_THROTTLING_HELPER_ H_
6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_THROTTLING_HELPER_ H_ 6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_THROTTLING_HELPER_ H_
7 7
8 #include <set> 8 #include <set>
9 #include <unordered_map> 9 #include <unordered_map>
10 10
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 : throttling_ref_count(ref_count), 191 : throttling_ref_count(ref_count),
192 enabled(is_enabled), 192 enabled(is_enabled),
193 time_budget_pool(nullptr) {} 193 time_budget_pool(nullptr) {}
194 194
195 size_t throttling_ref_count; 195 size_t throttling_ref_count;
196 bool enabled; 196 bool enabled;
197 197
198 TimeBudgetPool* time_budget_pool; 198 TimeBudgetPool* time_budget_pool;
199 199
200 bool IsThrottled() const { return throttling_ref_count > 0; } 200 bool IsThrottled() const { return throttling_ref_count > 0; }
201
202 void SetQueueEnabled(TaskQueue* task_queue);
203 }; 201 };
204 using TaskQueueMap = std::unordered_map<TaskQueue*, Metadata>; 202 using TaskQueueMap = std::unordered_map<TaskQueue*, Metadata>;
205 203
206 void PumpThrottledTasks(); 204 void PumpThrottledTasks();
207 205
208 // Note |unthrottled_runtime| might be in the past. When this happens we 206 // Note |unthrottled_runtime| might be in the past. When this happens we
209 // compute the delay to the next runtime based on now rather than 207 // compute the delay to the next runtime based on now rather than
210 // unthrottled_runtime. 208 // unthrottled_runtime.
211 void MaybeSchedulePumpThrottledTasks( 209 void MaybeSchedulePumpThrottledTasks(
212 const tracked_objects::Location& from_here, 210 const tracked_objects::Location& from_here,
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 243
246 base::WeakPtrFactory<TaskQueueThrottler> weak_factory_; 244 base::WeakPtrFactory<TaskQueueThrottler> weak_factory_;
247 245
248 DISALLOW_COPY_AND_ASSIGN(TaskQueueThrottler); 246 DISALLOW_COPY_AND_ASSIGN(TaskQueueThrottler);
249 }; 247 };
250 248
251 } // namespace scheduler 249 } // namespace scheduler
252 } // namespace blink 250 } // namespace blink
253 251
254 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_THROTTLING_HELP ER_H_ 252 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_THROTTLING_HELP ER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698