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

Unified Diff: components/scheduler/test/lazy_scheduler_message_loop_delegate_for_tests.cc

Issue 987193002: Redirect the MessageLoop's task runner to the renderer scheduler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Another API update. 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 side-by-side diff with in-line comments
Download patch
Index: components/scheduler/test/lazy_scheduler_message_loop_delegate_for_tests.cc
diff --git a/components/scheduler/test/lazy_scheduler_message_loop_delegate_for_tests.cc b/components/scheduler/test/lazy_scheduler_message_loop_delegate_for_tests.cc
index 999d8567a1f03be79f526b42b6aa6340254a80df..1ad2b172236c3c7e84eb8215dda6b8e58a78af66 100644
--- a/components/scheduler/test/lazy_scheduler_message_loop_delegate_for_tests.cc
+++ b/components/scheduler/test/lazy_scheduler_message_loop_delegate_for_tests.cc
@@ -33,9 +33,20 @@ base::MessageLoop* LazySchedulerMessageLoopDelegateForTests::EnsureMessageLoop()
message_loop_->AddTaskObserver(observer);
}
pending_observers_.clear();
+ if (pending_task_runner_)
+ message_loop_->SetTaskRunner(pending_task_runner_.Pass());
return message_loop_;
}
+void LazySchedulerMessageLoopDelegateForTests::SetDefaultTaskRunner(
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner) {
+ if (!HasMessageLoop()) {
+ pending_task_runner_ = task_runner.Pass();
+ return;
+ }
+ message_loop_->SetTaskRunner(task_runner.Pass());
+}
+
bool LazySchedulerMessageLoopDelegateForTests::HasMessageLoop() const {
return message_loop_ != nullptr;
}

Powered by Google App Engine
This is Rietveld 408576698