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

Unified Diff: base/task_scheduler/task_tracker.cc

Issue 2427963002: Support FileDescriptorWatcher in TaskScheduler. (Closed)
Patch Set: fix build error (add BASE_EXPORT) Created 4 years, 2 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
« no previous file with comments | « base/task_scheduler/task_tracker.h ('k') | base/task_scheduler/task_tracker_posix.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/task_scheduler/task_tracker.cc
diff --git a/base/task_scheduler/task_tracker.cc b/base/task_scheduler/task_tracker.cc
index be54614bec03fc63c555e8435cf62c529f642904..90c52937747ea459761ad8b972b6f4b2c6e2b8a7 100644
--- a/base/task_scheduler/task_tracker.cc
+++ b/base/task_scheduler/task_tracker.cc
@@ -213,6 +213,7 @@ bool TaskTracker::RunTask(std::unique_ptr<Task> task,
const TaskShutdownBehavior shutdown_behavior =
task->traits.shutdown_behavior();
const bool can_run_task = BeforeRunTask(shutdown_behavior);
+ const bool is_delayed = !task->delayed_run_time.is_null();
if (can_run_task) {
// All tasks run through here and the scheduler itself doesn't use
@@ -254,14 +255,13 @@ bool TaskTracker::RunTask(std::unique_ptr<Task> task,
MakeUnique<TaskTracingInfo>(task->traits, execution_mode,
sequence_token));
- debug::TaskAnnotator task_annotator;
- task_annotator.RunTask(kQueueFunctionName, task.get());
+ PerformRunTask(std::move(task));
}
AfterRunTask(shutdown_behavior);
}
- if (task->delayed_run_time.is_null())
+ if (!is_delayed)
DecrementNumPendingUndelayedTasks();
return can_run_task;
@@ -280,6 +280,10 @@ void TaskTracker::SetHasShutdownStartedForTesting() {
state_->StartShutdown();
}
+void TaskTracker::PerformRunTask(std::unique_ptr<Task> task) {
+ debug::TaskAnnotator().RunTask(kQueueFunctionName, task.get());
+}
+
void TaskTracker::PerformShutdown() {
{
AutoSchedulerLock auto_lock(shutdown_lock_);
« no previous file with comments | « base/task_scheduler/task_tracker.h ('k') | base/task_scheduler/task_tracker_posix.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698