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

Unified Diff: components/scheduler/child/webthread_impl_for_worker_scheduler.cc

Issue 1424053002: Adds a flag to support "Virtual Time" to the blink scheduler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Helps if I upload the right files ;) Created 5 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
Index: components/scheduler/child/webthread_impl_for_worker_scheduler.cc
diff --git a/components/scheduler/child/webthread_impl_for_worker_scheduler.cc b/components/scheduler/child/webthread_impl_for_worker_scheduler.cc
index 0706d53efdf000187c76eaa80e1460b778b2c3bc..f9ed74319b9d86759fd02dc537fc1e30b92ba492 100644
--- a/components/scheduler/child/webthread_impl_for_worker_scheduler.cc
+++ b/components/scheduler/child/webthread_impl_for_worker_scheduler.cc
@@ -8,6 +8,7 @@
#include "base/location.h"
#include "base/single_thread_task_runner.h"
#include "base/synchronization/waitable_event.h"
+#include "base/time/default_tick_clock.h"
#include "components/scheduler/base/task_queue.h"
#include "components/scheduler/child/scheduler_task_runner_delegate_impl.h"
#include "components/scheduler/child/web_scheduler_impl.h"
@@ -43,8 +44,10 @@ WebThreadImplForWorkerScheduler::~WebThreadImplForWorkerScheduler() {
void WebThreadImplForWorkerScheduler::InitOnThread(
base::WaitableEvent* completion) {
- task_runner_delegate_ =
- SchedulerTaskRunnerDelegateImpl::Create(thread_->message_loop());
+ // TODO(alexclarke): Do we need to unify virtual time for workers and the
+ // main thread?
Sami 2015/10/30 11:11:20 One issue here is that workers will see virtual ti
alex clarke (OOO till 29th) 2015/10/30 12:12:25 Acknowledged.
+ task_runner_delegate_ = SchedulerTaskRunnerDelegateImpl::Create(
+ thread_->message_loop(), make_scoped_ptr(new base::DefaultTickClock()));
worker_scheduler_ = WorkerScheduler::Create(task_runner_delegate_);
worker_scheduler_->Init();
task_runner_ = worker_scheduler_->DefaultTaskRunner();

Powered by Google App Engine
This is Rietveld 408576698