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

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

Issue 1308183005: Introduce WebTaskRunner Patch 2/5 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Final tweaks Created 5 years, 3 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 | « components/scheduler/child/web_scheduler_impl.h ('k') | components/scheduler/child/web_task_runner_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/scheduler/child/web_scheduler_impl.cc
diff --git a/components/scheduler/child/web_scheduler_impl.cc b/components/scheduler/child/web_scheduler_impl.cc
index 9a0ca5a73b617142b44ec6ed57bd988f0413b291..5a59277aa272ab6b41c5e5978909ed0c7709ea29 100644
--- a/components/scheduler/child/web_scheduler_impl.cc
+++ b/components/scheduler/child/web_scheduler_impl.cc
@@ -6,6 +6,7 @@
#include "base/bind.h"
#include "base/single_thread_task_runner.h"
+#include "components/scheduler/child/web_task_runner_impl.h"
#include "components/scheduler/child/worker_scheduler.h"
#include "third_party/WebKit/public/platform/WebTraceLocation.h"
@@ -19,7 +20,9 @@ WebSchedulerImpl::WebSchedulerImpl(
: child_scheduler_(child_scheduler),
idle_task_runner_(idle_task_runner),
loading_task_runner_(loading_task_runner),
- timer_task_runner_(timer_task_runner) {}
+ timer_task_runner_(timer_task_runner),
+ loading_web_task_runner_(new WebTaskRunnerImpl(loading_task_runner)),
+ timer_web_task_runner_(new WebTaskRunnerImpl(timer_task_runner)) {}
WebSchedulerImpl::~WebSchedulerImpl() {
}
@@ -120,6 +123,14 @@ void WebSchedulerImpl::postTimerTask(
base::TimeDelta::FromSecondsD(delaySecs));
}
+blink::WebTaskRunner* WebSchedulerImpl::loadingTaskRunner() {
+ return loading_web_task_runner_.get();
+}
+
+blink::WebTaskRunner* WebSchedulerImpl::timerTaskRunner() {
+ return timer_web_task_runner_.get();
+}
+
void WebSchedulerImpl::postTimerTaskAt(
const blink::WebTraceLocation& web_location,
blink::WebThread::Task* task,
@@ -134,4 +145,16 @@ void WebSchedulerImpl::postTimerTaskAt(
base::TimeTicks() + base::TimeDelta::FromSecondsD(monotonicTime));
}
+void WebSchedulerImpl::postTimerTaskAt(
+ const blink::WebTraceLocation& web_location,
+ blink::WebTaskRunner::Task* task,
+ double monotonicTime) {
+ DCHECK(timer_task_runner_);
+ tracked_objects::Location location(web_location.functionName(),
+ web_location.fileName(), -1, nullptr);
+ timer_task_runner_->PostDelayedTaskAt(
+ location, base::Bind(&blink::WebTaskRunner::Task::run, base::Owned(task)),
+ base::TimeTicks() + base::TimeDelta::FromSecondsD(monotonicTime));
+}
+
} // namespace scheduler
« no previous file with comments | « components/scheduler/child/web_scheduler_impl.h ('k') | components/scheduler/child/web_task_runner_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698