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

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

Issue 1237283006: Extract trace from TaskAnnotator::RunTask to its call sites (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed cros build (now for real) Created 5 years, 5 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 | « base/message_loop/message_loop.cc ('k') | components/timers/alarm_timer_chromeos.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 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 673 matching lines...) Expand 10 before | Expand all | Expand 10 after
684 } else { 684 } else {
685 // Suppress "will" task observer notifications for the first and "did" 685 // Suppress "will" task observer notifications for the first and "did"
686 // notifications for the last task in the batch to avoid duplicate 686 // notifications for the last task in the batch to avoid duplicate
687 // notifications. 687 // notifications.
688 if (has_previous_task) { 688 if (has_previous_task) {
689 FOR_EACH_OBSERVER(base::MessageLoop::TaskObserver, task_observers_, 689 FOR_EACH_OBSERVER(base::MessageLoop::TaskObserver, task_observers_,
690 DidProcessTask(*previous_task)); 690 DidProcessTask(*previous_task));
691 FOR_EACH_OBSERVER(base::MessageLoop::TaskObserver, task_observers_, 691 FOR_EACH_OBSERVER(base::MessageLoop::TaskObserver, task_observers_,
692 WillProcessTask(pending_task)); 692 WillProcessTask(pending_task));
693 } 693 }
694 task_annotator_.RunTask("TaskQueueManager::PostTask", 694
695 "TaskQueueManager::RunTask", pending_task); 695 TRACE_TASK_EXECUTION("TaskQueueManager::ProcessTaskFromWorkQueue",
696 pending_task);
697 task_annotator_.RunTask("TaskQueueManager::PostTask", pending_task);
696 698
697 // Detect if the TaskQueueManager just got deleted. If this happens we must 699 // Detect if the TaskQueueManager just got deleted. If this happens we must
698 // not access any member variables after this point. 700 // not access any member variables after this point.
699 if (protect->HasOneRef()) 701 if (protect->HasOneRef())
700 return true; 702 return true;
701 703
702 pending_task.task.Reset(); 704 pending_task.task.Reset();
703 *previous_task = pending_task; 705 *previous_task = pending_task;
704 } 706 }
705 return false; 707 return false;
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
810 return nullptr; 812 return nullptr;
811 } 813 }
812 } 814 }
813 815
814 void TaskQueueManager::OnTaskQueueEnabled() { 816 void TaskQueueManager::OnTaskQueueEnabled() {
815 DCHECK(main_thread_checker_.CalledOnValidThread()); 817 DCHECK(main_thread_checker_.CalledOnValidThread());
816 MaybePostDoWorkOnMainRunner(); 818 MaybePostDoWorkOnMainRunner();
817 } 819 }
818 820
819 } // namespace scheduler 821 } // namespace scheduler
OLDNEW
« no previous file with comments | « base/message_loop/message_loop.cc ('k') | components/timers/alarm_timer_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698