OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 TaskRunnerHelper_h | 5 #ifndef TaskRunnerHelper_h |
6 #define TaskRunnerHelper_h | 6 #define TaskRunnerHelper_h |
7 | 7 |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
9 #include "platform/wtf/Allocator.h" | 9 #include "platform/wtf/Allocator.h" |
10 #include "platform/wtf/HashTraits.h" | 10 #include "platform/wtf/HashTraits.h" |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
116 // may be throttled. | 116 // may be throttled. |
117 // | 117 // |
118 // UnspecedLoading type should be used for all tasks associated with | 118 // UnspecedLoading type should be used for all tasks associated with |
119 // loading page content, UnspecedTimer should be used for all other purposes. | 119 // loading page content, UnspecedTimer should be used for all other purposes. |
120 kUnspecedTimer, | 120 kUnspecedTimer, |
121 kUnspecedLoading, | 121 kUnspecedLoading, |
122 | 122 |
123 // Tasks that must not be throttled should be posted here, but the usage | 123 // Tasks that must not be throttled should be posted here, but the usage |
124 // should be very limited. | 124 // should be very limited. |
125 kUnthrottled, | 125 kUnthrottled, |
126 | |
127 // Tasks related to animating images should be posted here. | |
Sami
2017/04/27 17:38:17
nit: No need to limit this to image animations --
Dan Elphick
2017/05/03 09:41:06
no longer required
| |
128 kAnimationTimer, | |
126 }; | 129 }; |
127 | 130 |
128 // HashTraits for TaskType. | 131 // HashTraits for TaskType. |
129 struct TaskTypeTraits : WTF::GenericHashTraits<TaskType> { | 132 struct TaskTypeTraits : WTF::GenericHashTraits<TaskType> { |
130 static const bool kEmptyValueIsZero = false; | 133 static const bool kEmptyValueIsZero = false; |
131 static TaskType EmptyValue() { return static_cast<TaskType>(-1); } | 134 static TaskType EmptyValue() { return static_cast<TaskType>(-1); } |
132 static void ConstructDeletedValue(TaskType& slot, bool) { | 135 static void ConstructDeletedValue(TaskType& slot, bool) { |
133 slot = static_cast<TaskType>(-2); | 136 slot = static_cast<TaskType>(-2); |
134 } | 137 } |
135 static bool IsDeletedValue(TaskType value) { | 138 static bool IsDeletedValue(TaskType value) { |
(...skipping 18 matching lines...) Expand all Loading... | |
154 // scope that corresponds to the given WorkerThread. Note that WorkerThread is | 157 // scope that corresponds to the given WorkerThread. Note that WorkerThread is |
155 // a per-global-scope object while the naming might sound differently. | 158 // a per-global-scope object while the naming might sound differently. |
156 // TODO(nhiroki): Rename WorkerThread to something that clarifies it's a | 159 // TODO(nhiroki): Rename WorkerThread to something that clarifies it's a |
157 // per-global-scope object. | 160 // per-global-scope object. |
158 static RefPtr<WebTaskRunner> Get(TaskType, WorkerThread*); | 161 static RefPtr<WebTaskRunner> Get(TaskType, WorkerThread*); |
159 }; | 162 }; |
160 | 163 |
161 } // namespace blink | 164 } // namespace blink |
162 | 165 |
163 #endif | 166 #endif |
OLD | NEW |