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

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

Issue 2761503002: [scheduler] CPUTimeBudgetPool: Require a minimal level of budget to run (Closed)
Patch Set: Remove #include <*stream> Created 3 years, 9 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_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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 void EnableThrottling(); 124 void EnableThrottling();
125 125
126 const ThrottledTimeDomain* time_domain() const { return time_domain_.get(); } 126 const ThrottledTimeDomain* time_domain() const { return time_domain_.get(); }
127 127
128 static base::TimeTicks AlignedThrottledRunTime( 128 static base::TimeTicks AlignedThrottledRunTime(
129 base::TimeTicks unthrottled_runtime); 129 base::TimeTicks unthrottled_runtime);
130 130
131 const scoped_refptr<TaskQueue>& task_runner() const { return task_runner_; } 131 const scoped_refptr<TaskQueue>& task_runner() const { return task_runner_; }
132 132
133 // Returned object is owned by |TaskQueueThrottler|. 133 // Returned object is owned by |TaskQueueThrottler|.
134 CPUTimeBudgetPool* CreateCPUTimeBudgetPool( 134 CPUTimeBudgetPool* CreateCPUTimeBudgetPool(const char* name);
135 const char* name,
136 base::Optional<base::TimeDelta> max_budget_level,
137 base::Optional<base::TimeDelta> max_throttling_duration);
138 135
139 // Accounts for given task for cpu-based throttling needs. 136 // Accounts for given task for cpu-based throttling needs.
140 void OnTaskRunTimeReported(TaskQueue* task_queue, 137 void OnTaskRunTimeReported(TaskQueue* task_queue,
141 base::TimeTicks start_time, 138 base::TimeTicks start_time,
142 base::TimeTicks end_time); 139 base::TimeTicks end_time);
143 140
144 void AsValueInto(base::trace_event::TracedValue* state, 141 void AsValueInto(base::trace_event::TracedValue* state,
145 base::TimeTicks now) const; 142 base::TimeTicks now) const;
146 private: 143 private:
147 struct Metadata { 144 struct Metadata {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 187
191 base::WeakPtrFactory<TaskQueueThrottler> weak_factory_; 188 base::WeakPtrFactory<TaskQueueThrottler> weak_factory_;
192 189
193 DISALLOW_COPY_AND_ASSIGN(TaskQueueThrottler); 190 DISALLOW_COPY_AND_ASSIGN(TaskQueueThrottler);
194 }; 191 };
195 192
196 } // namespace scheduler 193 } // namespace scheduler
197 } // namespace blink 194 } // namespace blink
198 195
199 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_TASK_QUEUE_THRO TTLER_H_ 196 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_TASK_QUEUE_THRO TTLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698