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

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

Issue 1132753008: Replaced TestNowSource with SimpleTestTickClock. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Corrected typo. Minor changes to keep parity with TestNowSource. 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 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 #ifndef CONTENT_RENDERER_SCHEDULER_TASK_QUEUE_MANAGER_H_ 5 #ifndef CONTENT_RENDERER_SCHEDULER_TASK_QUEUE_MANAGER_H_
6 #define CONTENT_RENDERER_SCHEDULER_TASK_QUEUE_MANAGER_H_ 6 #define CONTENT_RENDERER_SCHEDULER_TASK_QUEUE_MANAGER_H_
7 7
8 #include "base/atomic_sequence_num.h" 8 #include "base/atomic_sequence_num.h"
9 #include "base/debug/task_annotator.h" 9 #include "base/debug/task_annotator.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 // back to the main message loop -- at the cost of potentially delaying other 152 // back to the main message loop -- at the cost of potentially delaying other
153 // tasks posted to the main loop. The batch size is 1 by default. 153 // tasks posted to the main loop. The batch size is 1 by default.
154 void SetWorkBatchSize(int work_batch_size); 154 void SetWorkBatchSize(int work_batch_size);
155 155
156 // These functions can only be called on the same thread that the task queue 156 // These functions can only be called on the same thread that the task queue
157 // manager executes its tasks on. 157 // manager executes its tasks on.
158 void AddTaskObserver(base::MessageLoop::TaskObserver* task_observer); 158 void AddTaskObserver(base::MessageLoop::TaskObserver* task_observer);
159 void RemoveTaskObserver(base::MessageLoop::TaskObserver* task_observer); 159 void RemoveTaskObserver(base::MessageLoop::TaskObserver* task_observer);
160 160
161 void SetTimeSourceForTesting(scoped_ptr<TimeSource> time_source); 161 void SetTimeSourceForTesting(scoped_ptr<TimeSource> time_source);
162 TimeSource* GetTimeSourceForTesting();
162 163
163 // Returns a bitmap where a bit is set iff a task on the corresponding queue 164 // Returns a bitmap where a bit is set iff a task on the corresponding queue
164 // was run since the last call to GetAndClearTaskWasRunOnQueueBitmap. 165 // was run since the last call to GetAndClearTaskWasRunOnQueueBitmap.
165 uint64 GetAndClearTaskWasRunOnQueueBitmap(); 166 uint64 GetAndClearTaskWasRunOnQueueBitmap();
166 167
167 private: 168 private:
168 // TaskQueueSelector::Observer implementation: 169 // TaskQueueSelector::Observer implementation:
169 void OnTaskQueueEnabled() override; 170 void OnTaskQueueEnabled() override;
170 171
171 friend class internal::LazyNow; 172 friend class internal::LazyNow;
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 257
257 scoped_refptr<DeletionSentinel> deletion_sentinel_; 258 scoped_refptr<DeletionSentinel> deletion_sentinel_;
258 base::WeakPtrFactory<TaskQueueManager> weak_factory_; 259 base::WeakPtrFactory<TaskQueueManager> weak_factory_;
259 260
260 DISALLOW_COPY_AND_ASSIGN(TaskQueueManager); 261 DISALLOW_COPY_AND_ASSIGN(TaskQueueManager);
261 }; 262 };
262 263
263 } // namespace scheduler 264 } // namespace scheduler
264 265
265 #endif // CONTENT_RENDERER_SCHEDULER_TASK_QUEUE_MANAGER_H_ 266 #endif // CONTENT_RENDERER_SCHEDULER_TASK_QUEUE_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698