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

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

Issue 1292983005: [scheduler]: Fix tracing issues with nested IdlePeriod trace events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add todo 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 unified diff | Download patch
« no previous file with comments | « components/scheduler/child/idle_helper.cc ('k') | no next file » | 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 "components/scheduler/child/task_queue_manager.h" 5 #include "components/scheduler/child/task_queue_manager.h"
6 6
7 #include <queue> 7 #include <queue>
8 #include <set> 8 #include <set>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 scoped_refptr<DeletionSentinel> protect(deletion_sentinel_); 274 scoped_refptr<DeletionSentinel> protect(deletion_sentinel_);
275 // TODO(alexclarke): consider std::move() when allowed. 275 // TODO(alexclarke): consider std::move() when allowed.
276 internal::TaskQueueImpl::Task pending_task = queue->TakeTaskFromWorkQueue(); 276 internal::TaskQueueImpl::Task pending_task = queue->TakeTaskFromWorkQueue();
277 277
278 if (queue->GetQuiescenceMonitored()) 278 if (queue->GetQuiescenceMonitored())
279 task_was_run_on_quiescence_monitored_queue_ = true; 279 task_was_run_on_quiescence_monitored_queue_ = true;
280 280
281 if (!pending_task.nestable && main_task_runner_->IsNested()) { 281 if (!pending_task.nestable && main_task_runner_->IsNested()) {
282 // Defer non-nestable work to the main task runner. NOTE these tasks can be 282 // Defer non-nestable work to the main task runner. NOTE these tasks can be
283 // arbitrarily delayed so the additional delay should not be a problem. 283 // arbitrarily delayed so the additional delay should not be a problem.
284 // TODO(skyostil): Figure out a way to not forget which task queue the
285 // task is associated with. See http://crbug.com/522843.
284 main_task_runner_->PostNonNestableTask(pending_task.posted_from, 286 main_task_runner_->PostNonNestableTask(pending_task.posted_from,
285 pending_task.task); 287 pending_task.task);
286 } else { 288 } else {
287 TRACE_TASK_EXECUTION("TaskQueueManager::ProcessTaskFromWorkQueue", 289 TRACE_TASK_EXECUTION("TaskQueueManager::ProcessTaskFromWorkQueue",
288 pending_task); 290 pending_task);
289 if (queue->GetShouldNotifyObservers()) { 291 if (queue->GetShouldNotifyObservers()) {
290 FOR_EACH_OBSERVER(base::MessageLoop::TaskObserver, task_observers_, 292 FOR_EACH_OBSERVER(base::MessageLoop::TaskObserver, task_observers_,
291 WillProcessTask(pending_task)); 293 WillProcessTask(pending_task));
292 } 294 }
293 task_annotator_.RunTask("TaskQueueManager::PostTask", pending_task); 295 task_annotator_.RunTask("TaskQueueManager::PostTask", pending_task);
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 } 385 }
384 386
385 void TaskQueueManager::OnTaskQueueEnabled(internal::TaskQueueImpl* queue) { 387 void TaskQueueManager::OnTaskQueueEnabled(internal::TaskQueueImpl* queue) {
386 DCHECK(main_thread_checker_.CalledOnValidThread()); 388 DCHECK(main_thread_checker_.CalledOnValidThread());
387 // Only schedule DoWork if there's something to do. 389 // Only schedule DoWork if there's something to do.
388 if (!queue->work_queue().empty()) 390 if (!queue->work_queue().empty())
389 MaybePostDoWorkOnMainRunner(); 391 MaybePostDoWorkOnMainRunner();
390 } 392 }
391 393
392 } // namespace scheduler 394 } // namespace scheduler
OLDNEW
« no previous file with comments | « components/scheduler/child/idle_helper.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698