Chromium Code Reviews| 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 24 matching lines...) Expand all Loading... | |
| 35 // The clock itself is provided by subclasses of the TimeDomain and it may be | 35 // The clock itself is provided by subclasses of the TimeDomain and it may be |
| 36 // the real wall clock or a synthetic (virtual) time base. | 36 // the real wall clock or a synthetic (virtual) time base. |
| 37 class BLINK_PLATFORM_EXPORT TimeDomain { | 37 class BLINK_PLATFORM_EXPORT TimeDomain { |
| 38 public: | 38 public: |
| 39 class BLINK_PLATFORM_EXPORT Observer { | 39 class BLINK_PLATFORM_EXPORT Observer { |
| 40 public: | 40 public: |
| 41 virtual ~Observer() {} | 41 virtual ~Observer() {} |
| 42 | 42 |
| 43 // Called when an empty TaskQueue registered with this TimeDomain has a task | 43 // Called when an empty TaskQueue registered with this TimeDomain has a task |
| 44 // enqueued. | 44 // enqueued. |
| 45 virtual void OnTimeDomainHasImmediateWork() = 0; | 45 virtual void OnTimeDomainHasImmediateWork(TaskQueue*) = 0; |
|
alex clarke (OOO till 29th)
2016/09/15 12:19:35
We're using chromium style here so please add a va
altimin
2016/09/15 15:52:10
Done.
| |
| 46 | 46 |
| 47 // Called when a TaskQueue registered with this TimeDomain has a delayed | 47 // Called when a TaskQueue registered with this TimeDomain has a delayed |
| 48 // task enqueued. | 48 // task enqueued. |
| 49 virtual void OnTimeDomainHasDelayedWork() = 0; | 49 virtual void OnTimeDomainHasDelayedWork(TaskQueue*) = 0; |
|
alex clarke (OOO till 29th)
2016/09/15 12:19:35
Ditto.
altimin
2016/09/15 15:52:10
Done.
| |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 explicit TimeDomain(Observer* observer); | 52 explicit TimeDomain(Observer* observer); |
| 53 virtual ~TimeDomain(); | 53 virtual ~TimeDomain(); |
| 54 | 54 |
| 55 // Returns a LazyNow that evaluate this TimeDomain's Now. Can be called from | 55 // Returns a LazyNow that evaluate this TimeDomain's Now. Can be called from |
| 56 // any thread. | 56 // any thread. |
| 57 // TODO(alexclarke): Make this main thread only. | 57 // TODO(alexclarke): Make this main thread only. |
| 58 virtual LazyNow CreateLazyNow() const = 0; | 58 virtual LazyNow CreateLazyNow() const = 0; |
| 59 | 59 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 160 | 160 |
| 161 base::ThreadChecker main_thread_checker_; | 161 base::ThreadChecker main_thread_checker_; |
| 162 | 162 |
| 163 DISALLOW_COPY_AND_ASSIGN(TimeDomain); | 163 DISALLOW_COPY_AND_ASSIGN(TimeDomain); |
| 164 }; | 164 }; |
| 165 | 165 |
| 166 } // namespace scheduler | 166 } // namespace scheduler |
| 167 } // namespace blink | 167 } // namespace blink |
| 168 | 168 |
| 169 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TIME_DOMAIN_H_ | 169 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TIME_DOMAIN_H_ |
| OLD | NEW |