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

Side by Side Diff: components/scheduler/base/task_queue_selector.h

Issue 1685093002: Fix bug with TaskQueueSelector and blocked queues (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Improve the dcheck Created 4 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_SCHEDULER_BASE_TASK_QUEUE_SELECTOR_H_ 5 #ifndef COMPONENTS_SCHEDULER_BASE_TASK_QUEUE_SELECTOR_H_
6 #define COMPONENTS_SCHEDULER_BASE_TASK_QUEUE_SELECTOR_H_ 6 #define COMPONENTS_SCHEDULER_BASE_TASK_QUEUE_SELECTOR_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <set> 10 #include <set>
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 // on the main thread. If |observer| is null, then no callbacks will occur. 78 // on the main thread. If |observer| is null, then no callbacks will occur.
79 void SetTaskQueueSelectorObserver(Observer* observer); 79 void SetTaskQueueSelectorObserver(Observer* observer);
80 80
81 // Returns true if all the enabled work queues are empty. Returns false 81 // Returns true if all the enabled work queues are empty. Returns false
82 // otherwise. 82 // otherwise.
83 bool EnabledWorkQueuesEmpty() const; 83 bool EnabledWorkQueuesEmpty() const;
84 84
85 protected: 85 protected:
86 class SCHEDULER_EXPORT PrioritizingSelector { 86 class SCHEDULER_EXPORT PrioritizingSelector {
87 public: 87 public:
88 PrioritizingSelector(TaskQueueSelector* task_queue_selector); 88 PrioritizingSelector(TaskQueueSelector* task_queue_selector,
89 const char* name);
89 90
90 void AssignQueueToSet(internal::TaskQueueImpl* queue, 91 void ChangeSetIndex(internal::TaskQueueImpl* queue,
91 TaskQueue::QueuePriority priority); 92 TaskQueue::QueuePriority priority);
93 void AddQueue(internal::TaskQueueImpl* queue,
94 TaskQueue::QueuePriority priority);
92 void RemoveQueue(internal::TaskQueueImpl* queue); 95 void RemoveQueue(internal::TaskQueueImpl* queue);
93 96
94 bool SelectWorkQueueToService(TaskQueue::QueuePriority max_priority, 97 bool SelectWorkQueueToService(TaskQueue::QueuePriority max_priority,
95 WorkQueue** out_work_queue, 98 WorkQueue** out_work_queue,
96 bool* out_chose_delayed_over_immediate); 99 bool* out_chose_delayed_over_immediate);
97 100
98 WorkQueueSets* delayed_work_queue_sets() { 101 WorkQueueSets* delayed_work_queue_sets() {
99 return &delayed_work_queue_sets_; 102 return &delayed_work_queue_sets_;
100 } 103 }
101 WorkQueueSets* immediate_work_queue_sets() { 104 WorkQueueSets* immediate_work_queue_sets() {
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 size_t num_blocked_queues_to_report_; 193 size_t num_blocked_queues_to_report_;
191 194
192 Observer* task_queue_selector_observer_; // NOT OWNED 195 Observer* task_queue_selector_observer_; // NOT OWNED
193 DISALLOW_COPY_AND_ASSIGN(TaskQueueSelector); 196 DISALLOW_COPY_AND_ASSIGN(TaskQueueSelector);
194 }; 197 };
195 198
196 } // namespace internal 199 } // namespace internal
197 } // namespace scheduler 200 } // namespace scheduler
198 201
199 #endif // COMPONENTS_SCHEDULER_BASE_TASK_QUEUE_SELECTOR_H 202 #endif // COMPONENTS_SCHEDULER_BASE_TASK_QUEUE_SELECTOR_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698