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

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

Issue 1163143002: Scheduler/child/TimeSource could be replaced with base/time/DefaultTickClock. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 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 COMPONENTS_SCHEDULER_CHILD_SCHEDULER_HELPER_H_ 5 #ifndef COMPONENTS_SCHEDULER_CHILD_SCHEDULER_HELPER_H_
6 #define COMPONENTS_SCHEDULER_CHILD_SCHEDULER_HELPER_H_ 6 #define COMPONENTS_SCHEDULER_CHILD_SCHEDULER_HELPER_H_
7 7
8 #include "base/time/default_tick_clock.h"
Sami 2015/06/04 13:51:47 Could you forward declare this instead?
Jimmy Jo 2015/06/05 00:45:09 Done.
8 #include "components/scheduler/child/prioritizing_task_queue_selector.h" 9 #include "components/scheduler/child/prioritizing_task_queue_selector.h"
9 #include "components/scheduler/child/task_queue_manager.h" 10 #include "components/scheduler/child/task_queue_manager.h"
10 #include "components/scheduler/child/time_source.h"
11 #include "components/scheduler/scheduler_export.h" 11 #include "components/scheduler/scheduler_export.h"
12 12
13 namespace scheduler { 13 namespace scheduler {
14 14
15 class NestableSingleThreadTaskRunner; 15 class NestableSingleThreadTaskRunner;
16 16
17 // Common scheduler functionality for default tasks. 17 // Common scheduler functionality for default tasks.
18 class SCHEDULER_EXPORT SchedulerHelper { 18 class SCHEDULER_EXPORT SchedulerHelper {
19 public: 19 public:
20 // NOTE |total_task_queue_count| must be >= TASK_QUEUE_COUNT. 20 // NOTE |total_task_queue_count| must be >= TASK_QUEUE_COUNT.
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 bool IsQueueEnabled(size_t queue_index) const; 86 bool IsQueueEnabled(size_t queue_index) const;
87 void SetPumpPolicy(size_t queue_index, 87 void SetPumpPolicy(size_t queue_index,
88 TaskQueueManager::PumpPolicy pump_policy); 88 TaskQueueManager::PumpPolicy pump_policy);
89 void SetWakeupPolicy(size_t queue_index, 89 void SetWakeupPolicy(size_t queue_index,
90 TaskQueueManager::WakeupPolicy wakeup_policy); 90 TaskQueueManager::WakeupPolicy wakeup_policy);
91 void PumpQueue(size_t queue_index); 91 void PumpQueue(size_t queue_index);
92 uint64 GetQuiescenceMonitoredTaskQueueMask() const; 92 uint64 GetQuiescenceMonitoredTaskQueueMask() const;
93 uint64 GetAndClearTaskWasRunOnQueueBitmap(); 93 uint64 GetAndClearTaskWasRunOnQueueBitmap();
94 94
95 // Test helpers. 95 // Test helpers.
96 void SetTimeSourceForTesting(scoped_ptr<TimeSource> time_source); 96 void SetTimeSourceForTesting(scoped_ptr<base::DefaultTickClock> time_source);
Sami 2015/06/04 13:51:47 I think this should be base::TickClock since we do
Jimmy Jo 2015/06/05 00:45:09 Done.
97 void SetWorkBatchSizeForTesting(size_t work_batch_size); 97 void SetWorkBatchSizeForTesting(size_t work_batch_size);
98 TaskQueueManager* GetTaskQueueManagerForTesting(); 98 TaskQueueManager* GetTaskQueueManagerForTesting();
99 99
100 private: 100 private:
101 friend class SchedulerHelperTest; 101 friend class SchedulerHelperTest;
102 102
103 base::ThreadChecker thread_checker_; 103 base::ThreadChecker thread_checker_;
104 scoped_ptr<PrioritizingTaskQueueSelector> task_queue_selector_; 104 scoped_ptr<PrioritizingTaskQueueSelector> task_queue_selector_;
105 scoped_ptr<TaskQueueManager> task_queue_manager_; 105 scoped_ptr<TaskQueueManager> task_queue_manager_;
106 106
107 uint64 quiescence_monitored_task_queue_mask_; 107 uint64 quiescence_monitored_task_queue_mask_;
108 108
109 scoped_refptr<base::SingleThreadTaskRunner> control_task_runner_; 109 scoped_refptr<base::SingleThreadTaskRunner> control_task_runner_;
110 scoped_refptr<base::SingleThreadTaskRunner> control_after_wakeup_task_runner_; 110 scoped_refptr<base::SingleThreadTaskRunner> control_after_wakeup_task_runner_;
111 scoped_refptr<base::SingleThreadTaskRunner> default_task_runner_; 111 scoped_refptr<base::SingleThreadTaskRunner> default_task_runner_;
112 112
113 scoped_ptr<TimeSource> time_source_; 113 scoped_ptr<base::DefaultTickClock> time_source_;
Sami 2015/06/04 13:51:47 base::TickClock here too.
Jimmy Jo 2015/06/05 00:45:09 Done.
114 114
115 const char* tracing_category_; 115 const char* tracing_category_;
116 const char* disabled_by_default_tracing_category_; 116 const char* disabled_by_default_tracing_category_;
117 117
118 DISALLOW_COPY_AND_ASSIGN(SchedulerHelper); 118 DISALLOW_COPY_AND_ASSIGN(SchedulerHelper);
119 }; 119 };
120 120
121 } // namespace scheduler 121 } // namespace scheduler
122 122
123 #endif // COMPONENTS_SCHEDULER_CHILD_SCHEDULER_HELPER_H_ 123 #endif // COMPONENTS_SCHEDULER_CHILD_SCHEDULER_HELPER_H_
OLDNEW
« no previous file with comments | « no previous file | components/scheduler/child/scheduler_helper.cc » ('j') | components/scheduler/child/task_queue_manager.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698