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

Side by Side Diff: cc/scheduler/begin_frame_tracker.h

Issue 787763006: cc: Adding BeginFrameTracker object and removing Now() from LTHI. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing gn bots. Created 6 years 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
(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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698