| 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_SOURCE_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_H_ | 5 #ifndef THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_H_ |
| 6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_H_ | 6 #define THIRD_PARTY_WEBKIT_SOURCE_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/optional.h" | 10 #include "base/optional.h" |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 virtual bool IsQueueEnabled() const = 0; | 155 virtual bool IsQueueEnabled() const = 0; |
| 156 | 156 |
| 157 // Returns true if the queue is completely empty. | 157 // Returns true if the queue is completely empty. |
| 158 virtual bool IsEmpty() const = 0; | 158 virtual bool IsEmpty() const = 0; |
| 159 | 159 |
| 160 // Returns the number of pending tasks in the queue. | 160 // Returns the number of pending tasks in the queue. |
| 161 virtual size_t GetNumberOfPendingTasks() const = 0; | 161 virtual size_t GetNumberOfPendingTasks() const = 0; |
| 162 | 162 |
| 163 // Returns true if the queue has work that's ready to execute now. | 163 // Returns true if the queue has work that's ready to execute now. |
| 164 // NOTE: this must be called on the thread this TaskQueue was created by. | 164 // NOTE: this must be called on the thread this TaskQueue was created by. |
| 165 virtual bool HasPendingImmediateWork() const = 0; | 165 virtual bool HasTaskToRunImmediately() const = 0; |
| 166 | 166 |
| 167 // Returns requested run time of next scheduled wake-up for a delayed task | 167 // Returns requested run time of next scheduled wake-up for a delayed task |
| 168 // which is not ready to run. If there are no such tasks or the queue is | 168 // which is not ready to run. If there are no such tasks or the queue is |
| 169 // disabled (by a QueueEnabledVoter) it returns base::nullopt. | 169 // disabled (by a QueueEnabledVoter) it returns base::nullopt. |
| 170 // NOTE: this must be called on the thread this TaskQueue was created by. | 170 // NOTE: this must be called on the thread this TaskQueue was created by. |
| 171 virtual base::Optional<base::TimeTicks> GetNextScheduledWakeUp() = 0; | 171 virtual base::Optional<base::TimeTicks> GetNextScheduledWakeUp() = 0; |
| 172 | 172 |
| 173 // Can be called on any thread. | 173 // Can be called on any thread. |
| 174 virtual QueueType GetQueueType() const = 0; | 174 virtual QueueType GetQueueType() const = 0; |
| 175 | 175 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 protected: | 230 protected: |
| 231 ~TaskQueue() override {} | 231 ~TaskQueue() override {} |
| 232 | 232 |
| 233 DISALLOW_COPY_AND_ASSIGN(TaskQueue); | 233 DISALLOW_COPY_AND_ASSIGN(TaskQueue); |
| 234 }; | 234 }; |
| 235 | 235 |
| 236 } // namespace scheduler | 236 } // namespace scheduler |
| 237 } // namespace blink | 237 } // namespace blink |
| 238 | 238 |
| 239 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_H_ | 239 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_H_ |
| OLD | NEW |