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

Side by Side Diff: components/scheduler/child/task_queue_manager.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: Responding to feedback 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 CONTENT_RENDERER_SCHEDULER_TASK_QUEUE_MANAGER_H_ 5 #ifndef CONTENT_RENDERER_SCHEDULER_TASK_QUEUE_MANAGER_H_
6 #define CONTENT_RENDERER_SCHEDULER_TASK_QUEUE_MANAGER_H_ 6 #define CONTENT_RENDERER_SCHEDULER_TASK_QUEUE_MANAGER_H_
7 7
8 #include "base/atomic_sequence_num.h" 8 #include "base/atomic_sequence_num.h"
9 #include "base/debug/task_annotator.h" 9 #include "base/debug/task_annotator.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 // manager executes its tasks on. 120 // manager executes its tasks on.
121 void AddTaskObserver(base::MessageLoop::TaskObserver* task_observer); 121 void AddTaskObserver(base::MessageLoop::TaskObserver* task_observer);
122 void RemoveTaskObserver(base::MessageLoop::TaskObserver* task_observer); 122 void RemoveTaskObserver(base::MessageLoop::TaskObserver* task_observer);
123 123
124 void SetTimeSourceForTesting(scoped_ptr<TimeSource> time_source); 124 void SetTimeSourceForTesting(scoped_ptr<TimeSource> time_source);
125 125
126 // Returns a bitmap where a bit is set iff a task on the corresponding queue 126 // Returns a bitmap where a bit is set iff a task on the corresponding queue
127 // was run since the last call to GetAndClearTaskWasRunOnQueueBitmap. 127 // was run since the last call to GetAndClearTaskWasRunOnQueueBitmap.
128 uint64 GetAndClearTaskWasRunOnQueueBitmap(); 128 uint64 GetAndClearTaskWasRunOnQueueBitmap();
129 129
130 void FlushQueue(size_t queue_index);
131
130 private: 132 private:
131 // TaskQueueSelector::Observer implementation: 133 // TaskQueueSelector::Observer implementation:
132 void OnTaskQueueEnabled() override; 134 void OnTaskQueueEnabled() override;
133 135
134 friend class internal::LazyNow; 136 friend class internal::LazyNow;
135 friend class internal::TaskQueue; 137 friend class internal::TaskQueue;
136 138
137 class DeletionSentinel : public base::RefCounted<DeletionSentinel> { 139 class DeletionSentinel : public base::RefCounted<DeletionSentinel> {
138 private: 140 private:
139 friend class base::RefCounted<DeletionSentinel>; 141 friend class base::RefCounted<DeletionSentinel>;
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 218
217 scoped_refptr<DeletionSentinel> deletion_sentinel_; 219 scoped_refptr<DeletionSentinel> deletion_sentinel_;
218 base::WeakPtrFactory<TaskQueueManager> weak_factory_; 220 base::WeakPtrFactory<TaskQueueManager> weak_factory_;
219 221
220 DISALLOW_COPY_AND_ASSIGN(TaskQueueManager); 222 DISALLOW_COPY_AND_ASSIGN(TaskQueueManager);
221 }; 223 };
222 224
223 } // namespace scheduler 225 } // namespace scheduler
224 226
225 #endif // CONTENT_RENDERER_SCHEDULER_TASK_QUEUE_MANAGER_H_ 227 #endif // CONTENT_RENDERER_SCHEDULER_TASK_QUEUE_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698