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

Unified Diff: components/scheduler/child/task_queue_manager.cc

Issue 1259583006: Reland: Explicitly track the scheduler task enqueueing order in a new field (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix the DCHECK Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: components/scheduler/child/task_queue_manager.cc
diff --git a/components/scheduler/child/task_queue_manager.cc b/components/scheduler/child/task_queue_manager.cc
index c557665ab7a4b6a5fac49b02fa6f58a461135f56..5906f7a68e21ffb797f190de1b77bb76748bd639 100644
--- a/components/scheduler/child/task_queue_manager.cc
+++ b/components/scheduler/child/task_queue_manager.cc
@@ -104,7 +104,7 @@ void TaskQueueManager::UnregisterAsUpdatableTaskQueue(
void TaskQueueManager::UpdateWorkQueues(
bool should_trigger_wakeup,
- const base::PendingTask* previous_task) {
+ const internal::TaskQueueImpl::Task* previous_task) {
DCHECK(main_thread_checker_.CalledOnValidThread());
internal::LazyNow lazy_now(this);
@@ -125,11 +125,6 @@ void TaskQueueManager::UpdateWorkQueues(
// as the iterator isn't the element being delated.
if (queue->work_queue().empty())
queue->UpdateWorkQueue(&lazy_now, should_trigger_wakeup, previous_task);
- if (!queue->work_queue().empty()) {
- // Currently we should not be getting tasks with delayed run times in any
- // of the work queues.
- DCHECK(queue->work_queue().front().delayed_run_time.is_null());
- }
}
}
@@ -159,8 +154,7 @@ void TaskQueueManager::DoWork(bool posted_from_main_thread) {
// pump-after-wakeup queue.
UpdateWorkQueues(false, nullptr);
- base::PendingTask previous_task((tracked_objects::Location()),
- (base::Closure()));
+ internal::TaskQueueImpl::Task previous_task;
for (int i = 0; i < work_batch_size_; i++) {
internal::TaskQueueImpl* queue;
if (!SelectQueueToService(&queue))
@@ -192,16 +186,18 @@ bool TaskQueueManager::SelectQueueToService(
return should_run;
}
-void TaskQueueManager::DidQueueTask(const base::PendingTask& pending_task) {
+void TaskQueueManager::DidQueueTask(
+ const internal::TaskQueueImpl::Task& pending_task) {
task_annotator_.DidQueueTask("TaskQueueManager::PostTask", pending_task);
}
bool TaskQueueManager::ProcessTaskFromWorkQueue(
internal::TaskQueueImpl* queue,
- base::PendingTask* out_previous_task) {
+ internal::TaskQueueImpl::Task* out_previous_task) {
DCHECK(main_thread_checker_.CalledOnValidThread());
scoped_refptr<DeletionSentinel> protect(deletion_sentinel_);
- base::PendingTask pending_task = queue->TakeTaskFromWorkQueue();
+ // TODO(alexclarke): consider std::move() when allowed.
+ internal::TaskQueueImpl::Task pending_task = queue->TakeTaskFromWorkQueue();
if (queue->GetQuiescenceMonitored())
task_was_run_on_quiescence_monitored_queue_ = true;
« no previous file with comments | « components/scheduler/child/task_queue_manager.h ('k') | components/scheduler/child/task_queue_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698