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

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

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: Fix comment 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: components/scheduler/child/prioritizing_task_queue_selector.h
diff --git a/components/scheduler/child/prioritizing_task_queue_selector.h b/components/scheduler/child/prioritizing_task_queue_selector.h
index a9a63eb12bde3fc5f0b6976ecce44f7db93509ac..b42482b6d291b9ca67d2c3e78a3736066ecf133d 100644
--- a/components/scheduler/child/prioritizing_task_queue_selector.h
+++ b/components/scheduler/child/prioritizing_task_queue_selector.h
@@ -41,14 +41,20 @@ class SCHEDULER_EXPORT PrioritizingTaskQueueSelector
PrioritizingTaskQueueSelector();
~PrioritizingTaskQueueSelector() override;
- // Set the priority of |queue_index| to |priority|.
+ // Blocks future EnableQueue or DisableQueue calls.
+ void PreShutdown();
+
+ // Set the priority of |queue_index| to |priority|. If PreShutdown() has been
+ // called this does nothing.
void SetQueuePriority(size_t queue_index, QueuePriority priority);
// Enable the |queue_index| with a priority of |priority|. By default all
- // queues are enabled with normal priority.
+ // queues are enabled with normal priority. If PreShutdown() has been called
+ // this does nothing.
void EnableQueue(size_t queue_index, QueuePriority priority);
- // Disable the |queue_index|.
+ // Disable the |queue_index|. If PreShutdown() has been called this does
+ // nothing.
void DisableQueue(size_t queue_index);
// Whether |queue_index| is enabled.
@@ -100,6 +106,7 @@ class SCHEDULER_EXPORT PrioritizingTaskQueueSelector
std::set<size_t> queue_priorities_[QUEUE_PRIORITY_COUNT];
size_t starvation_count_;
Observer* task_queue_selector_observer_; // NOT OWNED
+ bool pre_shutdown_;
DISALLOW_COPY_AND_ASSIGN(PrioritizingTaskQueueSelector);
};
« no previous file with comments | « components/scheduler/child/null_worker_scheduler.cc ('k') | components/scheduler/child/prioritizing_task_queue_selector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698