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

Unified Diff: mojo/services/html_viewer/web_scheduler_impl.cc

Issue 1101703003: 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: Rebase of DOOM 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
Index: mojo/services/html_viewer/web_scheduler_impl.cc
diff --git a/mojo/services/html_viewer/web_scheduler_impl.cc b/mojo/services/html_viewer/web_scheduler_impl.cc
index c0dbc93cb03492dc59e79cd777b512a4ebfd3304..e0ef1cdfacbc3bec327385a946dee006e3cabe6f 100644
--- a/mojo/services/html_viewer/web_scheduler_impl.cc
+++ b/mojo/services/html_viewer/web_scheduler_impl.cc
@@ -46,12 +46,29 @@ 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?
sky 2015/04/23 16:35:37 Add a NOTIMPLEMENTED here.
alex clarke (OOO till 29th) 2015/04/23 17:34:32 Done.
+}
+
// static
void WebSchedulerImpl::RunIdleTask(
scoped_ptr<blink::WebThread::IdleTask> task) {

Powered by Google App Engine
This is Rietveld 408576698