OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CC_SCHEDULER_BEGIN_FRAME_TRACKER_H_ | |
6 #define CC_SCHEDULER_BEGIN_FRAME_TRACKER_H_ | |
7 | |
8 #include <set> | |
9 #include <string> | |
10 | |
11 #include "base/debug/trace_event.h" | |
12 #include "base/location.h" | |
13 #include "cc/output/begin_frame_args.h" | |
14 | |
15 #define BEGINFRAMETRACKER_FROM_HERE FROM_HERE_WITH_EXPLICIT_FUNCTION("") | |
16 | |
17 namespace cc { | |
18 | |
19 // Microclass to trace and check properties for correct BeginFrameArgs usage. | |
brianderson
2014/12/18 02:01:38
Can you explain more about why this class exists?
mithro-old
2014/12/18 17:22:40
It centralises a bunch of things;
* State about t
| |
20 // TODO(mithro): Record stats about the BeginFrameArgs | |
21 class CC_EXPORT BeginFrameTracker { | |
brianderson
2014/12/18 02:01:38
Can you provide descriptions for each of the publi
mithro-old
2014/12/18 17:22:40
Done.
| |
22 public: | |
23 explicit BeginFrameTracker(const tracked_objects::Location& location); | |
24 ~BeginFrameTracker(); | |
25 | |
26 void Start(BeginFrameArgs new_args); | |
27 const BeginFrameArgs& Get() const; | |
28 bool HasFinished() const { return !current_finished_at_.is_null(); } | |
29 void Finish(); | |
30 const BeginFrameArgs& Last() const; | |
31 | |
32 base::TimeDelta Interval() const; | |
33 | |
34 private: | |
35 const tracked_objects::Location location_; | |
36 const std::string location_string_; | |
37 | |
38 base::TimeTicks current_updated_at_; | |
39 BeginFrameArgs current_args_; | |
40 base::TimeTicks current_finished_at_; | |
41 }; | |
42 | |
43 } // namespace cc | |
44 | |
45 #endif // CC_SCHEDULER_BEGIN_FRAME_TRACKER_H_ | |
OLD | NEW |