Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(333)

Side by Side Diff: third_party/WebKit/Source/platform/scheduler/base/real_time_domain.h

Issue 2798563003: [scheduler] Add TaskQueue::Observer (Closed)
Patch Set: add todo for test timings & wake_up -> wake-up in comments Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_REAL_TIME_DOMAIN_H_ 5 #ifndef THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_REAL_TIME_DOMAIN_H_
6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_REAL_TIME_DOMAIN_H_ 6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_REAL_TIME_DOMAIN_H_
7 7
8 #include <set> 8 #include <set>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "platform/scheduler/base/time_domain.h" 11 #include "platform/scheduler/base/time_domain.h"
12 #include "public/platform/WebCommon.h" 12 #include "public/platform/WebCommon.h"
13 13
14 namespace blink { 14 namespace blink {
15 namespace scheduler { 15 namespace scheduler {
16 16
17 class BLINK_PLATFORM_EXPORT RealTimeDomain : public TimeDomain { 17 class BLINK_PLATFORM_EXPORT RealTimeDomain : public TimeDomain {
18 public: 18 public:
19 explicit RealTimeDomain(const char* tracing_category); 19 explicit RealTimeDomain(const char* tracing_category);
20 RealTimeDomain(TimeDomain::Observer* observer, const char* tracing_category);
21 ~RealTimeDomain() override; 20 ~RealTimeDomain() override;
22 21
23 // TimeDomain implementation: 22 // TimeDomain implementation:
24 LazyNow CreateLazyNow() const override; 23 LazyNow CreateLazyNow() const override;
25 base::TimeTicks Now() const override; 24 base::TimeTicks Now() const override;
26 base::Optional<base::TimeDelta> DelayTillNextTask(LazyNow* lazy_now) override; 25 base::Optional<base::TimeDelta> DelayTillNextTask(LazyNow* lazy_now) override;
27 const char* GetName() const override; 26 const char* GetName() const override;
28 27
29 protected: 28 protected:
30 void OnRegisterWithTaskQueueManager( 29 void OnRegisterWithTaskQueueManager(
31 TaskQueueManager* task_queue_manager) override; 30 TaskQueueManager* task_queue_manager) override;
32 void RequestWakeupAt(base::TimeTicks now, base::TimeTicks run_time) override; 31 void RequestWakeUpAt(base::TimeTicks now, base::TimeTicks run_time) override;
33 void CancelWakeupAt(base::TimeTicks run_time) override; 32 void CancelWakeUpAt(base::TimeTicks run_time) override;
34 void AsValueIntoInternal( 33 void AsValueIntoInternal(
35 base::trace_event::TracedValue* state) const override; 34 base::trace_event::TracedValue* state) const override;
36 35
37 private: 36 private:
38 const char* tracing_category_; // NOT OWNED 37 const char* tracing_category_; // NOT OWNED
39 TaskQueueManager* task_queue_manager_; // NOT OWNED 38 TaskQueueManager* task_queue_manager_; // NOT OWNED
40 39
41 DISALLOW_COPY_AND_ASSIGN(RealTimeDomain); 40 DISALLOW_COPY_AND_ASSIGN(RealTimeDomain);
42 }; 41 };
43 42
44 } // namespace scheduler 43 } // namespace scheduler
45 } // namespace blink 44 } // namespace blink
46 45
47 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_REAL_TIME_DOMAIN_H_ 46 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_REAL_TIME_DOMAIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698