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

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

Issue 2517383004: [scheduler] Bunch of improvements for blink scheduler tracing (Closed)
Patch Set: git cl try 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_RENDERER_SCHEDULER _IMPL_H_ 5 #ifndef THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_RENDERER_SCHEDULER _IMPL_H_
6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_RENDERER_SCHEDULER _IMPL_H_ 6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_RENDERER_SCHEDULER _IMPL_H_
7 7
8 #include "base/atomicops.h" 8 #include "base/atomicops.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/synchronization/lock.h" 10 #include "base/synchronization/lock.h"
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 friend class RenderWidgetSchedulingState; 194 friend class RenderWidgetSchedulingState;
195 195
196 enum class ExpensiveTaskPolicy { RUN, BLOCK, THROTTLE }; 196 enum class ExpensiveTaskPolicy { RUN, BLOCK, THROTTLE };
197 197
198 enum class TimeDomainType { 198 enum class TimeDomainType {
199 REAL, 199 REAL,
200 THROTTLED, 200 THROTTLED,
201 VIRTUAL, 201 VIRTUAL,
202 }; 202 };
203 203
204 static const char* TimeDomainTypeToString(TimeDomainType domain_type);
205
204 struct TaskQueuePolicy { 206 struct TaskQueuePolicy {
205 TaskQueuePolicy() 207 TaskQueuePolicy()
206 : is_enabled(true), 208 : is_enabled(true),
207 priority(TaskQueue::NORMAL_PRIORITY), 209 priority(TaskQueue::NORMAL_PRIORITY),
208 time_domain_type(TimeDomainType::REAL) {} 210 time_domain_type(TimeDomainType::REAL) {}
209 211
210 bool is_enabled; 212 bool is_enabled;
211 TaskQueue::QueuePriority priority; 213 TaskQueue::QueuePriority priority;
212 TimeDomainType time_domain_type; 214 TimeDomainType time_domain_type;
213 215
214 bool operator==(const TaskQueuePolicy& other) const { 216 bool operator==(const TaskQueuePolicy& other) const {
215 return is_enabled == other.is_enabled && priority == other.priority && 217 return is_enabled == other.is_enabled && priority == other.priority &&
216 time_domain_type == other.time_domain_type; 218 time_domain_type == other.time_domain_type;
217 } 219 }
220
221 void AsValueInto(base::trace_event::TracedValue* state) const;
218 }; 222 };
219 223
220 struct Policy { 224 struct Policy {
221 TaskQueuePolicy compositor_queue_policy; 225 TaskQueuePolicy compositor_queue_policy;
222 TaskQueuePolicy loading_queue_policy; 226 TaskQueuePolicy loading_queue_policy;
223 TaskQueuePolicy timer_queue_policy; 227 TaskQueuePolicy timer_queue_policy;
224 TaskQueuePolicy default_queue_policy; 228 TaskQueuePolicy default_queue_policy;
225 v8::RAILMode rail_mode = v8::PERFORMANCE_ANIMATION; 229 v8::RAILMode rail_mode = v8::PERFORMANCE_ANIMATION;
226 bool should_disable_throttling = false; 230 bool should_disable_throttling = false;
227 231
228 bool operator==(const Policy& other) const { 232 bool operator==(const Policy& other) const {
229 return compositor_queue_policy == other.compositor_queue_policy && 233 return compositor_queue_policy == other.compositor_queue_policy &&
230 loading_queue_policy == other.loading_queue_policy && 234 loading_queue_policy == other.loading_queue_policy &&
231 timer_queue_policy == other.timer_queue_policy && 235 timer_queue_policy == other.timer_queue_policy &&
232 default_queue_policy == other.default_queue_policy && 236 default_queue_policy == other.default_queue_policy &&
233 rail_mode == other.rail_mode && 237 rail_mode == other.rail_mode &&
234 should_disable_throttling == other.should_disable_throttling; 238 should_disable_throttling == other.should_disable_throttling;
235 } 239 }
240
241 void AsValueInto(base::trace_event::TracedValue* state) const;
236 }; 242 };
237 243
238 class PollableNeedsUpdateFlag { 244 class PollableNeedsUpdateFlag {
239 public: 245 public:
240 PollableNeedsUpdateFlag(base::Lock* write_lock); 246 PollableNeedsUpdateFlag(base::Lock* write_lock);
241 ~PollableNeedsUpdateFlag(); 247 ~PollableNeedsUpdateFlag();
242 248
243 // Set the flag. May only be called if |write_lock| is held. 249 // Set the flag. May only be called if |write_lock| is held.
244 void SetWhileLocked(bool value); 250 void SetWhileLocked(bool value);
245 251
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 PollableThreadSafeFlag policy_may_need_update_; 498 PollableThreadSafeFlag policy_may_need_update_;
493 base::WeakPtrFactory<RendererSchedulerImpl> weak_factory_; 499 base::WeakPtrFactory<RendererSchedulerImpl> weak_factory_;
494 500
495 DISALLOW_COPY_AND_ASSIGN(RendererSchedulerImpl); 501 DISALLOW_COPY_AND_ASSIGN(RendererSchedulerImpl);
496 }; 502 };
497 503
498 } // namespace scheduler 504 } // namespace scheduler
499 } // namespace blink 505 } // namespace blink
500 506
501 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_RENDERER_SCHEDU LER_IMPL_H_ 507 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_RENDERER_SCHEDU LER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698