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

Unified Diff: components/scheduler/child/child_scheduler.h

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.cc ('k') | components/scheduler/child/null_worker_scheduler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/scheduler/child/child_scheduler.h
diff --git a/components/scheduler/child/child_scheduler.h b/components/scheduler/child/child_scheduler.h
index 8fd5359e8cfc38647aa567031a51f34384dcc526..10812260e6dada30c7cbb55fd0771ecc8e276dd5 100644
--- a/components/scheduler/child/child_scheduler.h
+++ b/components/scheduler/child/child_scheduler.h
@@ -27,6 +27,10 @@ class SCHEDULER_EXPORT ChildScheduler {
// time if no idle time is available.
virtual scoped_refptr<SingleThreadIdleTaskRunner> IdleTaskRunner() = 0;
+ // Returns the shutdown task runner. Intended for tasks that must be able to
+ // run even after PreShutdown() is called.
+ virtual scoped_refptr<base::SingleThreadTaskRunner> ShutdownTaskRunner() = 0;
+
// Returns true if there is high priority work pending on the main thread
// and the caller should yield to let the scheduler service that work. Note
// that this is a stricter condition than |IsHighPriorityWorkAnticipated|,
@@ -52,6 +56,10 @@ class SCHEDULER_EXPORT ChildScheduler {
virtual void RemoveTaskObserver(
base::MessageLoop::TaskObserver* task_observer) = 0;
+ // Optional. This stops all queues except for the shutdown queue. Must be
+ // called from the thread this scheduler was created on.
+ virtual void PreShutdown() = 0;
+
// Shuts down the scheduler by dropping any remaining pending work in the work
// queues. After this call any work posted to the task runners will be
// silently dropped.
« no previous file with comments | « components/html_viewer/web_scheduler_impl.cc ('k') | components/scheduler/child/null_worker_scheduler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698