Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 THIRD_PARTY_WEBKIT_PUBLIC_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_H_ | 5 #ifndef THIRD_PARTY_WEBKIT_PUBLIC_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_H_ |
| 6 #define THIRD_PARTY_WEBKIT_PUBLIC_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_H_ | 6 #define THIRD_PARTY_WEBKIT_PUBLIC_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 137 // Enable or disable task execution for this queue. NOTE this must be called | 137 // Enable or disable task execution for this queue. NOTE this must be called |
| 138 // on the thread this TaskQueue was created by. | 138 // on the thread this TaskQueue was created by. |
| 139 virtual void SetQueueEnabled(bool enabled) = 0; | 139 virtual void SetQueueEnabled(bool enabled) = 0; |
| 140 | 140 |
| 141 // NOTE this must be called on the thread this TaskQueue was created by. | 141 // NOTE this must be called on the thread this TaskQueue was created by. |
| 142 virtual bool IsQueueEnabled() const = 0; | 142 virtual bool IsQueueEnabled() const = 0; |
| 143 | 143 |
| 144 // Returns true if the queue is completely empty. | 144 // Returns true if the queue is completely empty. |
| 145 virtual bool IsEmpty() const = 0; | 145 virtual bool IsEmpty() const = 0; |
| 146 | 146 |
| 147 // Returns true if the queue has work that's ready to execute now. NOTE this | 147 // Returns true if the queue has work that's ready to execute now. |
| 148 // must be called on the thread this TaskQueue was created by. | 148 // NOTE: this must be called on the thread this TaskQueue was created by. |
| 149 virtual bool HasPendingImmediateWork() const = 0; | 149 virtual bool HasPendingImmediateWork() const = 0; |
| 150 | 150 |
| 151 // Returns true if the queue has delayed tasks which are not ready to run. | |
| 152 // If result is true, sets |wakeup| to the time of next delayed task. | |
| 153 // NOTE: this must be called on the thread this TaskQueue was created by. | |
| 154 virtual bool NextScheduledWakeUp(base::TimeTicks* wakeup) = 0; | |
|
Sami
2016/09/07 15:20:44
nit: GetNext... to match the naming around here.
altimin
2016/09/09 15:43:58
Done.
| |
| 155 | |
| 151 // Can be called on any thread. | 156 // Can be called on any thread. |
| 152 virtual const char* GetName() const = 0; | 157 virtual const char* GetName() const = 0; |
| 153 | 158 |
| 154 // Set the priority of the queue to |priority|. NOTE this must be called on | 159 // Set the priority of the queue to |priority|. NOTE this must be called on |
| 155 // the thread this TaskQueue was created by. | 160 // the thread this TaskQueue was created by. |
| 156 virtual void SetQueuePriority(QueuePriority priority) = 0; | 161 virtual void SetQueuePriority(QueuePriority priority) = 0; |
| 157 | 162 |
| 158 // Returns the current queue priority. | 163 // Returns the current queue priority. |
| 159 virtual QueuePriority GetQueuePriority() const = 0; | 164 virtual QueuePriority GetQueuePriority() const = 0; |
| 160 | 165 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 194 protected: | 199 protected: |
| 195 ~TaskQueue() override {} | 200 ~TaskQueue() override {} |
| 196 | 201 |
| 197 DISALLOW_COPY_AND_ASSIGN(TaskQueue); | 202 DISALLOW_COPY_AND_ASSIGN(TaskQueue); |
| 198 }; | 203 }; |
| 199 | 204 |
| 200 } // namespace scheduler | 205 } // namespace scheduler |
| 201 } // namespace blink | 206 } // namespace blink |
| 202 | 207 |
| 203 #endif // THIRD_PARTY_WEBKIT_PUBLIC_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_H_ | 208 #endif // THIRD_PARTY_WEBKIT_PUBLIC_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_H_ |
| OLD | NEW |