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

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

Issue 1089833002: Introduce ChildScheduler as common base interface for WorkerScheduler and RendererScheduler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix nits 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
« no previous file with comments | « content/child/scheduler/worker_scheduler_impl.h ('k') | content/content_child.gypi » ('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 #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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 WorkerSchedulerImpl::IdleTaskRunner() { 45 WorkerSchedulerImpl::IdleTaskRunner() {
46 DCHECK(initialized_); 46 DCHECK(initialized_);
47 return helper_.IdleTaskRunner(); 47 return helper_.IdleTaskRunner();
48 } 48 }
49 49
50 bool WorkerSchedulerImpl::CanExceedIdleDeadlineIfRequired() const { 50 bool WorkerSchedulerImpl::CanExceedIdleDeadlineIfRequired() const {
51 DCHECK(initialized_); 51 DCHECK(initialized_);
52 return helper_.CanExceedIdleDeadlineIfRequired(); 52 return helper_.CanExceedIdleDeadlineIfRequired();
53 } 53 }
54 54
55 bool WorkerSchedulerImpl::ShouldYieldForHighPriorityWork() {
56 // We don't consider any work as being high priority on workers.
57 return false;
58 }
59
55 void WorkerSchedulerImpl::AddTaskObserver( 60 void WorkerSchedulerImpl::AddTaskObserver(
56 base::MessageLoop::TaskObserver* task_observer) { 61 base::MessageLoop::TaskObserver* task_observer) {
57 DCHECK(initialized_); 62 DCHECK(initialized_);
58 helper_.AddTaskObserver(task_observer); 63 helper_.AddTaskObserver(task_observer);
59 } 64 }
60 65
61 void WorkerSchedulerImpl::RemoveTaskObserver( 66 void WorkerSchedulerImpl::RemoveTaskObserver(
62 base::MessageLoop::TaskObserver* task_observer) { 67 base::MessageLoop::TaskObserver* task_observer) {
63 DCHECK(initialized_); 68 DCHECK(initialized_);
64 helper_.RemoveTaskObserver(task_observer); 69 helper_.RemoveTaskObserver(task_observer);
(...skipping 18 matching lines...) Expand all
83 return true; 88 return true;
84 } 89 }
85 90
86 base::TimeTicks WorkerSchedulerImpl::CurrentIdleTaskDeadlineForTesting() const { 91 base::TimeTicks WorkerSchedulerImpl::CurrentIdleTaskDeadlineForTesting() const {
87 base::TimeTicks deadline; 92 base::TimeTicks deadline;
88 helper_.CurrentIdleTaskDeadlineCallback(&deadline); 93 helper_.CurrentIdleTaskDeadlineCallback(&deadline);
89 return deadline; 94 return deadline;
90 } 95 }
91 96
92 } // namespace content 97 } // namespace content
OLDNEW
« no previous file with comments | « content/child/scheduler/worker_scheduler_impl.h ('k') | content/content_child.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698