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

Side by Side Diff: content/child/scheduler/scheduler_helper.h

Issue 1059323003: scheduler: Encapsulate TaskQueueManager inside SchedulerHelper (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: GCC build fix. 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 | « no previous file | content/child/scheduler/scheduler_helper.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_CHILD_SCHEDULER_SCHEDULER_HELPER_H_ 5 #ifndef CONTENT_CHILD_SCHEDULER_SCHEDULER_HELPER_H_
6 #define CONTENT_CHILD_SCHEDULER_SCHEDULER_HELPER_H_ 6 #define CONTENT_CHILD_SCHEDULER_SCHEDULER_HELPER_H_
7 7
8 #include "cc/test/test_now_source.h" 8 #include "cc/test/test_now_source.h"
9 #include "content/child/scheduler/cancelable_closure_holder.h" 9 #include "content/child/scheduler/cancelable_closure_holder.h"
10 #include "content/child/scheduler/single_thread_idle_task_runner.h" 10 #include "content/child/scheduler/single_thread_idle_task_runner.h"
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 static bool IsInIdlePeriod(IdlePeriodState state); 151 static bool IsInIdlePeriod(IdlePeriodState state);
152 152
153 void CheckOnValidThread() const { 153 void CheckOnValidThread() const {
154 DCHECK(thread_checker_.CalledOnValidThread()); 154 DCHECK(thread_checker_.CalledOnValidThread());
155 } 155 }
156 156
157 // Accessor methods. 157 // Accessor methods.
158 base::TimeTicks Now() const; 158 base::TimeTicks Now() const;
159 IdlePeriodState SchedulerIdlePeriodState() const; 159 IdlePeriodState SchedulerIdlePeriodState() const;
160 PrioritizingTaskQueueSelector* SchedulerTaskQueueSelector() const; 160 PrioritizingTaskQueueSelector* SchedulerTaskQueueSelector() const;
161 TaskQueueManager* SchedulerTaskQueueManager() const; 161 scoped_refptr<base::SingleThreadTaskRunner> TaskRunnerForQueue(
162 size_t queue_index) const;
163 void SetQueueName(size_t queue_index, const char* name);
164 bool IsQueueEmpty(size_t queue_index) const;
162 165
163 // Test helpers. 166 // Test helpers.
164 void SetTimeSourceForTesting(scoped_refptr<cc::TestNowSource> time_source); 167 void SetTimeSourceForTesting(scoped_refptr<cc::TestNowSource> time_source);
165 void SetWorkBatchSizeForTesting(size_t work_batch_size); 168 void SetWorkBatchSizeForTesting(size_t work_batch_size);
166 169
167 private: 170 private:
168 friend class SchedulerHelperTest; 171 friend class SchedulerHelperTest;
169 172
170 bool ShouldWaitForQuiescence(); 173 bool ShouldWaitForQuiescence();
171 void EnableLongIdlePeriodAfterWakeup(); 174 void EnableLongIdlePeriodAfterWakeup();
(...skipping 27 matching lines...) Expand all
199 202
200 base::WeakPtr<SchedulerHelper> weak_scheduler_ptr_; 203 base::WeakPtr<SchedulerHelper> weak_scheduler_ptr_;
201 base::WeakPtrFactory<SchedulerHelper> weak_factory_; 204 base::WeakPtrFactory<SchedulerHelper> weak_factory_;
202 205
203 DISALLOW_COPY_AND_ASSIGN(SchedulerHelper); 206 DISALLOW_COPY_AND_ASSIGN(SchedulerHelper);
204 }; 207 };
205 208
206 } // namespace content 209 } // namespace content
207 210
208 #endif // CONTENT_CHILD_SCHEDULER_SCHEDULER_HELPER_H_ 211 #endif // CONTENT_CHILD_SCHEDULER_SCHEDULER_HELPER_H_
OLDNEW
« no previous file with comments | « no previous file | content/child/scheduler/scheduler_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698