| 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_TIME_DOMAIN_H_ | 5 #ifndef THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TIME_DOMAIN_H_ |
| 6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TIME_DOMAIN_H_ | 6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TIME_DOMAIN_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
| 16 #include "platform/scheduler/base/intrusive_heap.h" | 16 #include "platform/scheduler/base/intrusive_heap.h" |
| 17 #include "platform/scheduler/base/lazy_now.h" | 17 #include "platform/scheduler/base/lazy_now.h" |
| 18 #include "platform/scheduler/base/task_queue_impl.h" | 18 #include "platform/scheduler/base/task_queue_impl.h" |
| 19 | 19 |
| 20 namespace blink { | 20 namespace blink { |
| 21 namespace scheduler { | 21 namespace scheduler { |
| 22 namespace internal { | 22 namespace internal { |
| 23 class TaskQueueImpl; | 23 class TaskQueueImpl; |
| 24 } // internal | 24 } // namespace internal |
| 25 class TaskQueueManager; | 25 class TaskQueueManager; |
| 26 | 26 |
| 27 // The TimeDomain's job is to wake task queues up when their next delayed tasks | 27 // The TimeDomain's job is to wake task queues up when their next delayed tasks |
| 28 // are due to fire. TaskQueues request a wake up via ScheduleDelayedWork, when | 28 // are due to fire. TaskQueues request a wake up via ScheduleDelayedWork, when |
| 29 // the wake up is due the TimeDomain calls TaskQueue::WakeUpForDelayedWork. | 29 // the wake up is due the TimeDomain calls TaskQueue::WakeUpForDelayedWork. |
| 30 // The TimeDomain communicates with the TaskQueueManager to actually schedule | 30 // The TimeDomain communicates with the TaskQueueManager to actually schedule |
| 31 // the wake-ups on the underlying base::MessageLoop. Various levels of de-duping | 31 // the wake-ups on the underlying base::MessageLoop. Various levels of de-duping |
| 32 // are employed to prevent unnecessary posting of TaskQueueManager::DoWork. | 32 // are employed to prevent unnecessary posting of TaskQueueManager::DoWork. |
| 33 // | 33 // |
| 34 // Note the TimeDomain only knows about the first wake-up per queue, it's the | 34 // Note the TimeDomain only knows about the first wake-up per queue, it's the |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 | 144 |
| 145 base::ThreadChecker main_thread_checker_; | 145 base::ThreadChecker main_thread_checker_; |
| 146 | 146 |
| 147 DISALLOW_COPY_AND_ASSIGN(TimeDomain); | 147 DISALLOW_COPY_AND_ASSIGN(TimeDomain); |
| 148 }; | 148 }; |
| 149 | 149 |
| 150 } // namespace scheduler | 150 } // namespace scheduler |
| 151 } // namespace blink | 151 } // namespace blink |
| 152 | 152 |
| 153 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TIME_DOMAIN_H_ | 153 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TIME_DOMAIN_H_ |
| OLD | NEW |