| 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/optional.h" | 10 #include "base/optional.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 // Queues with normal priority are the default. | 47 // Queues with normal priority are the default. |
| 48 NORMAL_PRIORITY, | 48 NORMAL_PRIORITY, |
| 49 // Queues with best effort priority will only be run if all other queues are | 49 // Queues with best effort priority will only be run if all other queues are |
| 50 // empty. They can be starved by the other queues. | 50 // empty. They can be starved by the other queues. |
| 51 BEST_EFFORT_PRIORITY, | 51 BEST_EFFORT_PRIORITY, |
| 52 // Must be the last entry. | 52 // Must be the last entry. |
| 53 QUEUE_PRIORITY_COUNT, | 53 QUEUE_PRIORITY_COUNT, |
| 54 FIRST_QUEUE_PRIORITY = CONTROL_PRIORITY, | 54 FIRST_QUEUE_PRIORITY = CONTROL_PRIORITY, |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 // Can be called on any thread. |
| 58 static const char* PriorityToString(QueuePriority priority); |
| 59 |
| 57 enum class QueueType { | 60 enum class QueueType { |
| 58 // Keep TaskQueue::NameForQueueType in sync. | 61 // Keep TaskQueue::NameForQueueType in sync. |
| 59 // This enum is used for a histogram and it should not be re-numbered. | 62 // This enum is used for a histogram and it should not be re-numbered. |
| 60 CONTROL = 0, | 63 CONTROL = 0, |
| 61 DEFAULT = 1, | 64 DEFAULT = 1, |
| 62 DEFAULT_LOADING = 2, | 65 DEFAULT_LOADING = 2, |
| 63 DEFAULT_TIMER = 3, | 66 DEFAULT_TIMER = 3, |
| 64 UNTHROTTLED = 4, | 67 UNTHROTTLED = 4, |
| 65 FRAME_LOADING = 5, | 68 FRAME_LOADING = 5, |
| 66 FRAME_TIMER = 6, | 69 FRAME_TIMER = 6, |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 protected: | 188 protected: |
| 186 ~TaskQueue() override {} | 189 ~TaskQueue() override {} |
| 187 | 190 |
| 188 DISALLOW_COPY_AND_ASSIGN(TaskQueue); | 191 DISALLOW_COPY_AND_ASSIGN(TaskQueue); |
| 189 }; | 192 }; |
| 190 | 193 |
| 191 } // namespace scheduler | 194 } // namespace scheduler |
| 192 } // namespace blink | 195 } // namespace blink |
| 193 | 196 |
| 194 #endif // THIRD_PARTY_WEBKIT_PUBLIC_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_H_ | 197 #endif // THIRD_PARTY_WEBKIT_PUBLIC_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_H_ |
| OLD | NEW |