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

Side by Side Diff: components/scheduler/child/task_queue.h

Issue 1303353003: scheduler: Disable expensive timers during main thread user input (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments. Created 5 years, 4 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
« no previous file with comments | « components/scheduler/BUILD.gn ('k') | components/scheduler/child/task_queue_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_CHILD_TASK_QUEUE_H_ 5 #ifndef COMPONENTS_SCHEDULER_CHILD_TASK_QUEUE_H_
6 #define COMPONENTS_SCHEDULER_CHILD_TASK_QUEUE_H_ 6 #define COMPONENTS_SCHEDULER_CHILD_TASK_QUEUE_H_
7 7
8 #include "base/message_loop/message_loop.h"
8 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
9 #include "components/scheduler/scheduler_export.h" 10 #include "components/scheduler/scheduler_export.h"
10 11
11 namespace scheduler { 12 namespace scheduler {
12 13
13 class SCHEDULER_EXPORT TaskQueue : public base::SingleThreadTaskRunner { 14 class SCHEDULER_EXPORT TaskQueue : public base::SingleThreadTaskRunner {
14 public: 15 public:
15 TaskQueue() {} 16 TaskQueue() {}
16 17
17 // Unregisters the task queue after which no tasks posted to it will run and 18 // Unregisters the task queue after which no tasks posted to it will run and
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 159
159 // Reloads new tasks from the incoming queue into the work queue, regardless 160 // Reloads new tasks from the incoming queue into the work queue, regardless
160 // of whether the work queue is empty or not. After this, the function ensures 161 // of whether the work queue is empty or not. After this, the function ensures
161 // that the tasks in the work queue, if any, are scheduled for execution. 162 // that the tasks in the work queue, if any, are scheduled for execution.
162 // 163 //
163 // This function only needs to be called if automatic pumping is disabled. 164 // This function only needs to be called if automatic pumping is disabled.
164 // By default automatic pumping is enabled for all queues. NOTE this must be 165 // By default automatic pumping is enabled for all queues. NOTE this must be
165 // called on the thread this TaskQueue was created by. 166 // called on the thread this TaskQueue was created by.
166 virtual void PumpQueue() = 0; 167 virtual void PumpQueue() = 0;
167 168
169 // These functions can only be called on the same thread that the task queue
170 // manager executes its tasks on.
171 virtual void AddTaskObserver(
172 base::MessageLoop::TaskObserver* task_observer) = 0;
173 virtual void RemoveTaskObserver(
174 base::MessageLoop::TaskObserver* task_observer) = 0;
175
168 protected: 176 protected:
169 ~TaskQueue() override {} 177 ~TaskQueue() override {}
170 178
171 DISALLOW_COPY_AND_ASSIGN(TaskQueue); 179 DISALLOW_COPY_AND_ASSIGN(TaskQueue);
172 }; 180 };
173 181
174 } // namespace scheduler 182 } // namespace scheduler
175 183
176 #endif // COMPONENTS_SCHEDULER_CHILD_TASK_QUEUE_H_ 184 #endif // COMPONENTS_SCHEDULER_CHILD_TASK_QUEUE_H_
OLDNEW
« no previous file with comments | « components/scheduler/BUILD.gn ('k') | components/scheduler/child/task_queue_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698