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

Side by Side Diff: content/child/scheduler/worker_scheduler_impl.cc

Issue 1098033002: Remove dependency on cc::TestNowSource from scheduler code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updates Created 5 years, 8 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 #include "content/child/scheduler/worker_scheduler_impl.h" 5 #include "content/child/scheduler/worker_scheduler_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop_proxy.h" 8 #include "base/message_loop/message_loop_proxy.h"
9 #include "base/trace_event/trace_event.h" 9 #include "base/trace_event/trace_event.h"
10 #include "base/trace_event/trace_event_argument.h" 10 #include "base/trace_event/trace_event_argument.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 base::MessageLoop::TaskObserver* task_observer) { 68 base::MessageLoop::TaskObserver* task_observer) {
69 DCHECK(initialized_); 69 DCHECK(initialized_);
70 helper_.RemoveTaskObserver(task_observer); 70 helper_.RemoveTaskObserver(task_observer);
71 } 71 }
72 72
73 void WorkerSchedulerImpl::Shutdown() { 73 void WorkerSchedulerImpl::Shutdown() {
74 DCHECK(initialized_); 74 DCHECK(initialized_);
75 helper_.Shutdown(); 75 helper_.Shutdown();
76 } 76 }
77 77
78 void WorkerSchedulerImpl::SetTimeSourceForTesting( 78 SchedulerHelper* WorkerSchedulerImpl::GetSchedulerHelperForTesting() {
79 scoped_refptr<cc::TestNowSource> time_source) { 79 return &helper_;
80 helper_.SetTimeSourceForTesting(time_source);
81 } 80 }
82 81
83 void WorkerSchedulerImpl::SetWorkBatchSizeForTesting(size_t work_batch_size) { 82 void WorkerSchedulerImpl::SetWorkBatchSizeForTesting(size_t work_batch_size) {
84 helper_.SetWorkBatchSizeForTesting(work_batch_size); 83 helper_.SetWorkBatchSizeForTesting(work_batch_size);
85 } 84 }
86 85
87 bool WorkerSchedulerImpl::CanEnterLongIdlePeriod(base::TimeTicks, 86 bool WorkerSchedulerImpl::CanEnterLongIdlePeriod(base::TimeTicks,
88 base::TimeDelta*) { 87 base::TimeDelta*) {
89 return true; 88 return true;
90 } 89 }
91 90
92 base::TimeTicks WorkerSchedulerImpl::CurrentIdleTaskDeadlineForTesting() const { 91 base::TimeTicks WorkerSchedulerImpl::CurrentIdleTaskDeadlineForTesting() const {
93 base::TimeTicks deadline; 92 base::TimeTicks deadline;
94 helper_.CurrentIdleTaskDeadlineCallback(&deadline); 93 helper_.CurrentIdleTaskDeadlineCallback(&deadline);
95 return deadline; 94 return deadline;
96 } 95 }
97 96
98 } // namespace content 97 } // namespace content
OLDNEW
« no previous file with comments | « content/child/scheduler/worker_scheduler_impl.h ('k') | content/child/scheduler/worker_scheduler_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698