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

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

Issue 1652083002: Prepare for per-webview virtual time (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rename useVirtualTime Created 4 years, 11 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/base/task_queue_manager.cc
diff --git a/components/scheduler/base/task_queue_manager.cc b/components/scheduler/base/task_queue_manager.cc
index 584eb703646e0173c5e79b748993e49a56760677..8ccf4ba31d7cb03baa6732102f71c3173e45fe05 100644
--- a/components/scheduler/base/task_queue_manager.cc
+++ b/components/scheduler/base/task_queue_manager.cc
@@ -218,12 +218,8 @@ void TaskQueueManager::DoWork(base::TimeTicks run_time, bool from_main_thread) {
// TODO(alexclarke): Consider refactoring the above loop to terminate only
// when there's no more work left to be done, rather than posting a
// continuation task.
- if (!selector_.EnabledWorkQueuesEmpty() || TryAdvanceTimeDomains()) {
+ if (!selector_.EnabledWorkQueuesEmpty() || TryAdvanceTimeDomains())
MaybeScheduleImmediateWork(FROM_HERE);
- } else {
- // Tell the task runner we have no more work.
- delegate_->OnNoMoreImmediateWork();
- }
}
bool TaskQueueManager::TryAdvanceTimeDomains() {
@@ -280,7 +276,11 @@ TaskQueueManager::ProcessTaskResult TaskQueueManager::ProcessTaskFromWorkQueue(
}
TRACE_EVENT1(tracing_category_,
"TaskQueueManager::RunTask", "queue", queue->GetName());
+ scoped_refptr<internal::TaskQueueImpl> prev_executing_task_queue =
Sami 2016/02/01 17:05:39 Let's go back to the raw pointer and add a comment
alex clarke (OOO till 29th) 2016/02/01 17:50:09 Done.
+ currently_executing_task_queue_;
+ currently_executing_task_queue_ = queue;
task_annotator_.RunTask("TaskQueueManager::PostTask", pending_task);
+ currently_executing_task_queue_ = prev_executing_task_queue;
// Detect if the TaskQueueManager just got deleted. If this happens we must
Sami 2016/02/01 17:05:39 Move to line 283.
alex clarke (OOO till 29th) 2016/02/01 17:50:09 Done.
// not access any member variables after this point.

Powered by Google App Engine
This is Rietveld 408576698