OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_MANAGER_H_ | 5 #ifndef THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_MANAGER_H_ |
6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_MANAGER_H_ | 6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/atomic_sequence_num.h" | 10 #include "base/atomic_sequence_num.h" |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 // Use the selector to choose a pending task and run it. | 245 // Use the selector to choose a pending task and run it. |
246 void DoWork(bool delayed); | 246 void DoWork(bool delayed); |
247 | 247 |
248 // Post a DoWork continuation if |next_delay| is not empty. | 248 // Post a DoWork continuation if |next_delay| is not empty. |
249 void PostDoWorkContinuationLocked(base::Optional<NextTaskDelay> next_delay, | 249 void PostDoWorkContinuationLocked(base::Optional<NextTaskDelay> next_delay, |
250 LazyNow* lazy_now, | 250 LazyNow* lazy_now, |
251 MoveableAutoLock&& lock); | 251 MoveableAutoLock&& lock); |
252 | 252 |
253 // Delayed Tasks with run_times <= Now() are enqueued onto the work queue and | 253 // Delayed Tasks with run_times <= Now() are enqueued onto the work queue and |
254 // reloads any empty work queues. | 254 // reloads any empty work queues. |
255 void WakeUpReadyDelayedQueues(LazyNow* lazy_now); | 255 void WakeupReadyDelayedQueues(LazyNow* lazy_now); |
256 | 256 |
257 // Chooses the next work queue to service. Returns true if |out_queue| | 257 // Chooses the next work queue to service. Returns true if |out_queue| |
258 // indicates the queue from which the next task should be run, false to | 258 // indicates the queue from which the next task should be run, false to |
259 // avoid running any tasks. | 259 // avoid running any tasks. |
260 bool SelectWorkQueueToService(internal::WorkQueue** out_work_queue); | 260 bool SelectWorkQueueToService(internal::WorkQueue** out_work_queue); |
261 | 261 |
262 enum class ProcessTaskResult { | 262 enum class ProcessTaskResult { |
263 DEFERRED, | 263 DEFERRED, |
264 EXECUTED, | 264 EXECUTED, |
265 TASK_QUEUE_MANAGER_DELETED | 265 TASK_QUEUE_MANAGER_DELETED |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 scoped_refptr<DeletionSentinel> deletion_sentinel_; | 382 scoped_refptr<DeletionSentinel> deletion_sentinel_; |
383 base::WeakPtrFactory<TaskQueueManager> weak_factory_; | 383 base::WeakPtrFactory<TaskQueueManager> weak_factory_; |
384 | 384 |
385 DISALLOW_COPY_AND_ASSIGN(TaskQueueManager); | 385 DISALLOW_COPY_AND_ASSIGN(TaskQueueManager); |
386 }; | 386 }; |
387 | 387 |
388 } // namespace scheduler | 388 } // namespace scheduler |
389 } // namespace blink | 389 } // namespace blink |
390 | 390 |
391 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_MANAGER_
H_ | 391 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_MANAGER_
H_ |
OLD | NEW |