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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 // Runs a single nestable task from the |queue|. On exit, |out_task| will | 266 // Runs a single nestable task from the |queue|. On exit, |out_task| will |
267 // contain the task which was executed. Non-nestable task are reposted on the | 267 // contain the task which was executed. Non-nestable task are reposted on the |
268 // run loop. The queue must not be empty. On exit |time_after_task| may get | 268 // run loop. The queue must not be empty. On exit |time_after_task| may get |
269 // set (not guaranteed), sampling |real_time_domain()->Now()| immediately | 269 // set (not guaranteed), sampling |real_time_domain()->Now()| immediately |
270 // after running the task. | 270 // after running the task. |
271 ProcessTaskResult ProcessTaskFromWorkQueue(internal::WorkQueue* work_queue, | 271 ProcessTaskResult ProcessTaskFromWorkQueue(internal::WorkQueue* work_queue, |
272 bool is_nested, | 272 bool is_nested, |
273 LazyNow time_before_task, | 273 LazyNow time_before_task, |
274 base::TimeTicks* time_after_task); | 274 base::TimeTicks* time_after_task); |
275 | 275 |
276 bool RunsTasksOnCurrentThread() const; | 276 bool RunsTasksInCurrentSequence() const; |
277 bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, | 277 bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, |
278 const base::Closure& task, | 278 const base::Closure& task, |
279 base::TimeDelta delay); | 279 base::TimeDelta delay); |
280 | 280 |
281 internal::EnqueueOrder GetNextSequenceNumber(); | 281 internal::EnqueueOrder GetNextSequenceNumber(); |
282 | 282 |
283 // Calls DelayTillNextTask on all time domains and returns the smallest delay | 283 // Calls DelayTillNextTask on all time domains and returns the smallest delay |
284 // requested if any. | 284 // requested if any. |
285 base::Optional<NextTaskDelay> ComputeDelayTillNextTaskLocked( | 285 base::Optional<NextTaskDelay> ComputeDelayTillNextTaskLocked( |
286 LazyNow* lazy_now); | 286 LazyNow* lazy_now); |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 scoped_refptr<DeletionSentinel> deletion_sentinel_; | 376 scoped_refptr<DeletionSentinel> deletion_sentinel_; |
377 base::WeakPtrFactory<TaskQueueManager> weak_factory_; | 377 base::WeakPtrFactory<TaskQueueManager> weak_factory_; |
378 | 378 |
379 DISALLOW_COPY_AND_ASSIGN(TaskQueueManager); | 379 DISALLOW_COPY_AND_ASSIGN(TaskQueueManager); |
380 }; | 380 }; |
381 | 381 |
382 } // namespace scheduler | 382 } // namespace scheduler |
383 } // namespace blink | 383 } // namespace blink |
384 | 384 |
385 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_MANAGER_
H_ | 385 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_MANAGER_
H_ |
OLD | NEW |