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

Unified Diff: components/html_viewer/web_scheduler_impl.cc

Issue 1106213002: Adds a SHUTDOWN_TASK_QUEUE and a PreShutdown api to the scheduler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments. Created 5 years, 8 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/html_viewer/web_scheduler_impl.h ('k') | components/scheduler/child/child_scheduler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/html_viewer/web_scheduler_impl.cc
diff --git a/components/html_viewer/web_scheduler_impl.cc b/components/html_viewer/web_scheduler_impl.cc
index 7f1ada5c1fb87506119f28da1b587086ed0ff913..f7202bfd323bd6d59b91b784d4785c7f7ee5059a 100644
--- a/components/html_viewer/web_scheduler_impl.cc
+++ b/components/html_viewer/web_scheduler_impl.cc
@@ -46,12 +46,30 @@ void WebSchedulerImpl::postTimerTask(
scoped_ptr<blink::WebThread::Task> scoped_task(task);
tracked_objects::Location location(web_location.functionName(),
web_location.fileName(), -1, nullptr);
- task_runner_->PostDelayedTask(
+ task_runner_->PostNonNestableDelayedTask(
location,
base::Bind(&WebSchedulerImpl::RunTask, base::Passed(&scoped_task)),
base::TimeDelta::FromMilliseconds(delayMs));
}
+void WebSchedulerImpl::postShutdownTask(
+ const blink::WebTraceLocation& web_location,
+ blink::WebThread::Task* task,
+ long long delayMs) {
+ scoped_ptr<blink::WebThread::Task> scoped_task(task);
+ tracked_objects::Location location(web_location.functionName(),
+ web_location.fileName(), -1, nullptr);
+ task_runner_->PostNonNestableDelayedTask(
+ location,
+ base::Bind(&WebSchedulerImpl::RunTask, base::Passed(&scoped_task)),
+ base::TimeDelta::FromMilliseconds(delayMs));
+}
+
+void WebSchedulerImpl::preShutdown() {
+ // TODO(alexclarke) Implement pre shutdown for mojo?
+ NOTIMPLEMENTED();
+}
+
// static
void WebSchedulerImpl::RunIdleTask(
scoped_ptr<blink::WebThread::IdleTask> task) {
« no previous file with comments | « components/html_viewer/web_scheduler_impl.h ('k') | components/scheduler/child/child_scheduler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698