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

Unified Diff: content/renderer/scheduler/web_scheduler_impl.cc

Issue 854053003: Adds support for loading tasks in WebSchedulerImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a #include Created 5 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
« no previous file with comments | « content/renderer/scheduler/web_scheduler_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/scheduler/web_scheduler_impl.cc
diff --git a/content/renderer/scheduler/web_scheduler_impl.cc b/content/renderer/scheduler/web_scheduler_impl.cc
index c0a340795b7e219933bafc318f1327f8cf59ad89..1ca8a302698478b6257dbfed7dcf45cac9d67fe8 100644
--- a/content/renderer/scheduler/web_scheduler_impl.cc
+++ b/content/renderer/scheduler/web_scheduler_impl.cc
@@ -28,6 +28,10 @@ void WebSchedulerImpl::runIdleTask(
task->run((deadline - base::TimeTicks()).InSecondsF());
}
+void WebSchedulerImpl::runTask(scoped_ptr<blink::WebThread::Task> task) {
+ task->run();
+}
+
void WebSchedulerImpl::postIdleTask(const blink::WebTraceLocation& web_location,
blink::WebScheduler::IdleTask* task) {
scoped_ptr<blink::WebScheduler::IdleTask> scoped_task(task);
@@ -38,6 +42,16 @@ void WebSchedulerImpl::postIdleTask(const blink::WebTraceLocation& web_location,
base::Bind(&WebSchedulerImpl::runIdleTask, base::Passed(&scoped_task)));
}
+void WebSchedulerImpl::postLoadingTask(
+ const blink::WebTraceLocation& web_location, blink::WebThread::Task* task) {
+ scoped_ptr<blink::WebThread::Task> scoped_task(task);
+ tracked_objects::Location location(web_location.functionName(),
+ web_location.fileName(), -1, nullptr);
+ renderer_scheduler_->LoadingTaskRunner()->PostTask(
+ location,
+ base::Bind(&WebSchedulerImpl::runTask, base::Passed(&scoped_task)));
+}
+
void WebSchedulerImpl::shutdown() {
return renderer_scheduler_->Shutdown();
}
« no previous file with comments | « content/renderer/scheduler/web_scheduler_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698