| 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" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 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 |
| 35 // responsibility of TaskQueueImpl to keep the time domain up to date if this | 35 // responsibility of TaskQueueImpl to keep the time domain up to date if this |
| 36 // changes. | 36 // changes. |
| 37 class BLINK_PLATFORM_EXPORT TimeDomain { | 37 class PLATFORM_EXPORT TimeDomain { |
| 38 public: | 38 public: |
| 39 TimeDomain(); | 39 TimeDomain(); |
| 40 virtual ~TimeDomain(); | 40 virtual ~TimeDomain(); |
| 41 | 41 |
| 42 // Returns a LazyNow that evaluate this TimeDomain's Now. Can be called from | 42 // Returns a LazyNow that evaluate this TimeDomain's Now. Can be called from |
| 43 // any thread. | 43 // any thread. |
| 44 // TODO(alexclarke): Make this main thread only. | 44 // TODO(alexclarke): Make this main thread only. |
| 45 virtual LazyNow CreateLazyNow() const = 0; | 45 virtual LazyNow CreateLazyNow() const = 0; |
| 46 | 46 |
| 47 // Evaluate this TimeDomain's Now. Can be called from any thread. | 47 // Evaluate this TimeDomain's Now. Can be called from any thread. |
| (...skipping 96 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 |