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

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

Issue 2548483002: [scheduler] Account for disabling throttling in TaskQueueThrottler::IsThrottled (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 Metadata(size_t ref_count, bool is_enabled) 228 Metadata(size_t ref_count, bool is_enabled)
229 : throttling_ref_count(ref_count), 229 : throttling_ref_count(ref_count),
230 enabled(is_enabled), 230 enabled(is_enabled),
231 time_budget_pool(nullptr) {} 231 time_budget_pool(nullptr) {}
232 232
233 size_t throttling_ref_count; 233 size_t throttling_ref_count;
234 bool enabled; 234 bool enabled;
235 235
236 TimeBudgetPool* time_budget_pool; 236 TimeBudgetPool* time_budget_pool;
237 237
238 bool IsThrottled() const { return throttling_ref_count > 0; }
239
240 void SetQueueEnabled(TaskQueue* task_queue); 238 void SetQueueEnabled(TaskQueue* task_queue);
241 }; 239 };
242 using TaskQueueMap = std::unordered_map<TaskQueue*, Metadata>; 240 using TaskQueueMap = std::unordered_map<TaskQueue*, Metadata>;
243 241
244 void PumpThrottledTasks(); 242 void PumpThrottledTasks();
245 243
246 // Note |unthrottled_runtime| might be in the past. When this happens we 244 // Note |unthrottled_runtime| might be in the past. When this happens we
247 // compute the delay to the next runtime based on now rather than 245 // compute the delay to the next runtime based on now rather than
248 // unthrottled_runtime. 246 // unthrottled_runtime.
249 void MaybeSchedulePumpThrottledTasks( 247 void MaybeSchedulePumpThrottledTasks(
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 281
284 base::WeakPtrFactory<TaskQueueThrottler> weak_factory_; 282 base::WeakPtrFactory<TaskQueueThrottler> weak_factory_;
285 283
286 DISALLOW_COPY_AND_ASSIGN(TaskQueueThrottler); 284 DISALLOW_COPY_AND_ASSIGN(TaskQueueThrottler);
287 }; 285 };
288 286
289 } // namespace scheduler 287 } // namespace scheduler
290 } // namespace blink 288 } // namespace blink
291 289
292 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_THROTTLING_HELP ER_H_ 290 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_THROTTLING_HELP ER_H_
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698