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

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

Issue 2841463003: scheduler: Make virtual time expiration deterministic (Closed)
Patch Set: Rebased Created 3 years, 7 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 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/gtest_prod_util.h" 9 #include "base/gtest_prod_util.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 // Returns a new timer task queue. This queue is intended for DOM Timers. 152 // Returns a new timer task queue. This queue is intended for DOM Timers.
153 scoped_refptr<TaskQueue> NewTimerTaskQueue(TaskQueue::QueueType queue_type); 153 scoped_refptr<TaskQueue> NewTimerTaskQueue(TaskQueue::QueueType queue_type);
154 154
155 // Returns a task queue for tasks which should never get throttled. 155 // Returns a task queue for tasks which should never get throttled.
156 scoped_refptr<TaskQueue> NewUnthrottledTaskQueue( 156 scoped_refptr<TaskQueue> NewUnthrottledTaskQueue(
157 TaskQueue::QueueType queue_type); 157 TaskQueue::QueueType queue_type);
158 158
159 // Returns a task queue where tasks run at the highest possible priority. 159 // Returns a task queue where tasks run at the highest possible priority.
160 scoped_refptr<TaskQueue> ControlTaskQueue(); 160 scoped_refptr<TaskQueue> ControlTaskQueue();
161 161
162 // A control task queue which also respects virtual time. Only available if
163 // virtual time has been enabled.
164 scoped_refptr<TaskQueue> VirtualTimeControlTaskQueue();
165
162 void RegisterTimeDomain(TimeDomain* time_domain); 166 void RegisterTimeDomain(TimeDomain* time_domain);
163 void UnregisterTimeDomain(TimeDomain* time_domain); 167 void UnregisterTimeDomain(TimeDomain* time_domain);
164 168
165 // Tells the scheduler that all TaskQueues should use virtual time. 169 // Tells the scheduler that all TaskQueues should use virtual time.
166 void EnableVirtualTime(); 170 void EnableVirtualTime();
167 171
168 // Migrates all task queues to real time. 172 // Migrates all task queues to real time.
169 void DisableVirtualTimeForTesting(); 173 void DisableVirtualTimeForTesting();
170 174
171 void AddWebViewScheduler(WebViewSchedulerImpl* web_view_scheduler); 175 void AddWebViewScheduler(WebViewSchedulerImpl* web_view_scheduler);
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 bool ShouldDisableThrottlingBecauseOfAudio(base::TimeTicks now); 399 bool ShouldDisableThrottlingBecauseOfAudio(base::TimeTicks now);
396 400
397 SchedulerHelper helper_; 401 SchedulerHelper helper_;
398 IdleHelper idle_helper_; 402 IdleHelper idle_helper_;
399 IdleCanceledDelayedTaskSweeper idle_canceled_delayed_task_sweeper_; 403 IdleCanceledDelayedTaskSweeper idle_canceled_delayed_task_sweeper_;
400 std::unique_ptr<TaskQueueThrottler> task_queue_throttler_; 404 std::unique_ptr<TaskQueueThrottler> task_queue_throttler_;
401 RenderWidgetSignals render_widget_scheduler_signals_; 405 RenderWidgetSignals render_widget_scheduler_signals_;
402 406
403 const scoped_refptr<TaskQueue> control_task_queue_; 407 const scoped_refptr<TaskQueue> control_task_queue_;
404 const scoped_refptr<TaskQueue> compositor_task_queue_; 408 const scoped_refptr<TaskQueue> compositor_task_queue_;
409 scoped_refptr<TaskQueue> virtual_time_control_task_queue_;
405 std::unique_ptr<TaskQueue::QueueEnabledVoter> 410 std::unique_ptr<TaskQueue::QueueEnabledVoter>
406 compositor_task_queue_enabled_voter_; 411 compositor_task_queue_enabled_voter_;
407 412
408 using TaskQueueVoterMap = 413 using TaskQueueVoterMap =
409 std::map<scoped_refptr<TaskQueue>, 414 std::map<scoped_refptr<TaskQueue>,
410 std::unique_ptr<TaskQueue::QueueEnabledVoter>>; 415 std::unique_ptr<TaskQueue::QueueEnabledVoter>>;
411 416
412 TaskQueueVoterMap loading_task_runners_; 417 TaskQueueVoterMap loading_task_runners_;
413 TaskQueueVoterMap timer_task_runners_; 418 TaskQueueVoterMap timer_task_runners_;
414 std::set<scoped_refptr<TaskQueue>> unthrottled_task_runners_; 419 std::set<scoped_refptr<TaskQueue>> unthrottled_task_runners_;
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 550
546 base::WeakPtrFactory<RendererSchedulerImpl> weak_factory_; 551 base::WeakPtrFactory<RendererSchedulerImpl> weak_factory_;
547 552
548 DISALLOW_COPY_AND_ASSIGN(RendererSchedulerImpl); 553 DISALLOW_COPY_AND_ASSIGN(RendererSchedulerImpl);
549 }; 554 };
550 555
551 } // namespace scheduler 556 } // namespace scheduler
552 } // namespace blink 557 } // namespace blink
553 558
554 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_RENDERER_SCHEDU LER_IMPL_H_ 559 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_RENDERER_SCHEDU LER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698