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

Side by Side Diff: components/scheduler/renderer/renderer_scheduler_impl.cc

Issue 1441073006: Move throttling of background timers into the renderer scheduler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Try again for MSVC Created 5 years, 1 month 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 #include "components/scheduler/renderer/renderer_scheduler_impl.h" 5 #include "components/scheduler/renderer/renderer_scheduler_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/debug/stack_trace.h" 8 #include "base/debug/stack_trace.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 RendererSchedulerImpl::LoadingTaskRunner() { 169 RendererSchedulerImpl::LoadingTaskRunner() {
170 helper_.CheckOnValidThread(); 170 helper_.CheckOnValidThread();
171 return default_loading_task_runner_; 171 return default_loading_task_runner_;
172 } 172 }
173 173
174 scoped_refptr<TaskQueue> RendererSchedulerImpl::TimerTaskRunner() { 174 scoped_refptr<TaskQueue> RendererSchedulerImpl::TimerTaskRunner() {
175 helper_.CheckOnValidThread(); 175 helper_.CheckOnValidThread();
176 return default_timer_task_runner_; 176 return default_timer_task_runner_;
177 } 177 }
178 178
179 scoped_refptr<TaskQueue> RendererSchedulerImpl::ControlTaskRunner() {
180 return helper_.ControlTaskRunner();
Sami 2015/11/17 10:12:21 nit: helper_.CheckOnValidThread();
alex clarke (OOO till 29th) 2015/11/23 17:13:45 Done.
181 }
182
179 scoped_refptr<TaskQueue> RendererSchedulerImpl::NewLoadingTaskRunner( 183 scoped_refptr<TaskQueue> RendererSchedulerImpl::NewLoadingTaskRunner(
180 const char* name) { 184 const char* name) {
181 helper_.CheckOnValidThread(); 185 helper_.CheckOnValidThread();
182 scoped_refptr<TaskQueue> loading_task_queue(helper_.NewTaskQueue( 186 scoped_refptr<TaskQueue> loading_task_queue(helper_.NewTaskQueue(
183 TaskQueue::Spec(name).SetShouldMonitorQuiescence(true))); 187 TaskQueue::Spec(name).SetShouldMonitorQuiescence(true)));
184 loading_task_runners_.insert(loading_task_queue); 188 loading_task_runners_.insert(loading_task_queue);
185 loading_task_queue->SetQueuePriority( 189 loading_task_queue->SetQueuePriority(
186 MainThreadOnly().current_policy.loading_queue_priority); 190 MainThreadOnly().current_policy.loading_queue_priority);
187 loading_task_queue->AddTaskObserver( 191 loading_task_queue->AddTaskObserver(
188 &MainThreadOnly().loading_task_cost_estimator); 192 &MainThreadOnly().loading_task_cost_estimator);
(...skipping 851 matching lines...) Expand 10 before | Expand all | Expand 10 after
1040 double RendererSchedulerImpl::CurrentTimeSeconds() const { 1044 double RendererSchedulerImpl::CurrentTimeSeconds() const {
1041 return helper_.scheduler_tqm_delegate()->CurrentTimeSeconds(); 1045 return helper_.scheduler_tqm_delegate()->CurrentTimeSeconds();
1042 } 1046 }
1043 1047
1044 double RendererSchedulerImpl::MonotonicallyIncreasingTimeSeconds() const { 1048 double RendererSchedulerImpl::MonotonicallyIncreasingTimeSeconds() const {
1045 return helper_.scheduler_tqm_delegate()->NowTicks().ToInternalValue() / 1049 return helper_.scheduler_tqm_delegate()->NowTicks().ToInternalValue() /
1046 static_cast<double>(base::Time::kMicrosecondsPerSecond); 1050 static_cast<double>(base::Time::kMicrosecondsPerSecond);
1047 } 1051 }
1048 1052
1049 } // namespace scheduler 1053 } // namespace scheduler
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698