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

Side by Side Diff: content/renderer/scheduler/renderer_scheduler_impl.h

Issue 1011103004: [renderer] Enable long idle times in the Blink Scheduler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove peerconnection_call change added for testing on the bots. Created 5 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
« no previous file with comments | « no previous file | content/renderer/scheduler/renderer_scheduler_impl.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 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 CONTENT_RENDERER_SCHEDULER_RENDERER_SCHEDULER_IMPL_H_ 5 #ifndef CONTENT_RENDERER_SCHEDULER_RENDERER_SCHEDULER_IMPL_H_
6 #define CONTENT_RENDERER_SCHEDULER_RENDERER_SCHEDULER_IMPL_H_ 6 #define CONTENT_RENDERER_SCHEDULER_RENDERER_SCHEDULER_IMPL_H_
7 7
8 #include "base/atomicops.h" 8 #include "base/atomicops.h"
9 #include "base/synchronization/lock.h" 9 #include "base/synchronization/lock.h"
10 #include "base/threading/thread_checker.h" 10 #include "base/threading/thread_checker.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 bool CanExceedIdleDeadlineIfRequired() const override; 46 bool CanExceedIdleDeadlineIfRequired() const override;
47 bool IsHighPriorityWorkAnticipated() override; 47 bool IsHighPriorityWorkAnticipated() override;
48 bool ShouldYieldForHighPriorityWork() override; 48 bool ShouldYieldForHighPriorityWork() override;
49 void AddTaskObserver(base::MessageLoop::TaskObserver* task_observer) override; 49 void AddTaskObserver(base::MessageLoop::TaskObserver* task_observer) override;
50 void RemoveTaskObserver( 50 void RemoveTaskObserver(
51 base::MessageLoop::TaskObserver* task_observer) override; 51 base::MessageLoop::TaskObserver* task_observer) override;
52 void Shutdown() override; 52 void Shutdown() override;
53 53
54 void SetTimeSourceForTesting(scoped_refptr<cc::TestNowSource> time_source); 54 void SetTimeSourceForTesting(scoped_refptr<cc::TestNowSource> time_source);
55 void SetWorkBatchSizeForTesting(size_t work_batch_size); 55 void SetWorkBatchSizeForTesting(size_t work_batch_size);
56 // TODO(rmcilroy): Remove this when http://crbug.com/467655 is fixed.
57 void SetLongIdlePeriodsEnabledForTesting(bool long_idle_periods_enabled);
58 56
59 private: 57 private:
60 friend class RendererSchedulerImplTest; 58 friend class RendererSchedulerImplTest;
61 friend class RendererSchedulerImplForTest; 59 friend class RendererSchedulerImplForTest;
62 60
63 // Keep RendererSchedulerImpl::TaskQueueIdToString in sync with this enum. 61 // Keep RendererSchedulerImpl::TaskQueueIdToString in sync with this enum.
64 enum QueueId { 62 enum QueueId {
65 DEFAULT_TASK_QUEUE, 63 DEFAULT_TASK_QUEUE,
66 COMPOSITOR_TASK_QUEUE, 64 COMPOSITOR_TASK_QUEUE,
67 LOADING_TASK_QUEUE, 65 LOADING_TASK_QUEUE,
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 base::Closure update_policy_closure_; 207 base::Closure update_policy_closure_;
210 DeadlineTaskRunner delayed_update_policy_runner_; 208 DeadlineTaskRunner delayed_update_policy_runner_;
211 CancelableClosureHolder end_idle_period_closure_; 209 CancelableClosureHolder end_idle_period_closure_;
212 CancelableClosureHolder initiate_next_long_idle_period_closure_; 210 CancelableClosureHolder initiate_next_long_idle_period_closure_;
213 CancelableClosureHolder initiate_next_long_idle_period_after_wakeup_closure_; 211 CancelableClosureHolder initiate_next_long_idle_period_after_wakeup_closure_;
214 212
215 // Don't access current_policy_ directly, instead use SchedulerPolicy(). 213 // Don't access current_policy_ directly, instead use SchedulerPolicy().
216 Policy current_policy_; 214 Policy current_policy_;
217 IdlePeriodState idle_period_state_; 215 IdlePeriodState idle_period_state_;
218 216
219 // TODO(rmcilroy): Remove this when http://crbug.com/467655 is fixed.
220 bool long_idle_periods_enabled_;
221
222 base::TimeTicks estimated_next_frame_begin_; 217 base::TimeTicks estimated_next_frame_begin_;
223 base::TimeTicks current_policy_expiration_time_; 218 base::TimeTicks current_policy_expiration_time_;
224 219
225 // The incoming_signals_lock_ mutex protects access to all variables in the 220 // The incoming_signals_lock_ mutex protects access to all variables in the
226 // (contiguous) block below. 221 // (contiguous) block below.
227 base::Lock incoming_signals_lock_; 222 base::Lock incoming_signals_lock_;
228 base::TimeTicks last_input_receipt_time_on_compositor_; 223 base::TimeTicks last_input_receipt_time_on_compositor_;
229 base::TimeTicks last_input_process_time_on_main_; 224 base::TimeTicks last_input_process_time_on_main_;
230 blink::WebInputEvent::Type last_input_type_; 225 blink::WebInputEvent::Type last_input_type_;
231 InputStreamState input_stream_state_; 226 InputStreamState input_stream_state_;
232 PollableNeedsUpdateFlag policy_may_need_update_; 227 PollableNeedsUpdateFlag policy_may_need_update_;
233 228
234 scoped_refptr<cc::TestNowSource> time_source_; 229 scoped_refptr<cc::TestNowSource> time_source_;
235 230
236 base::WeakPtr<RendererSchedulerImpl> weak_renderer_scheduler_ptr_; 231 base::WeakPtr<RendererSchedulerImpl> weak_renderer_scheduler_ptr_;
237 base::WeakPtrFactory<RendererSchedulerImpl> weak_factory_; 232 base::WeakPtrFactory<RendererSchedulerImpl> weak_factory_;
238 233
239 DISALLOW_COPY_AND_ASSIGN(RendererSchedulerImpl); 234 DISALLOW_COPY_AND_ASSIGN(RendererSchedulerImpl);
240 }; 235 };
241 236
242 } // namespace content 237 } // namespace content
243 238
244 #endif // CONTENT_RENDERER_SCHEDULER_RENDERER_SCHEDULER_IMPL_H_ 239 #endif // CONTENT_RENDERER_SCHEDULER_RENDERER_SCHEDULER_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | content/renderer/scheduler/renderer_scheduler_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698