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

Side by Side Diff: cc/debug/frame_timing_tracker.h

Issue 1535833002: Delete CC. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-5
Patch Set: rebase Created 4 years, 11 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
« no previous file with comments | « cc/debug/frame_timing_request.cc ('k') | cc/debug/frame_timing_tracker.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CC_DEBUG_FRAME_TIMING_TRACKER_H_
6 #define CC_DEBUG_FRAME_TIMING_TRACKER_H_
7
8 #include <utility>
9 #include <vector>
10
11 #include "base/basictypes.h"
12 #include "base/containers/hash_tables.h"
13 #include "base/memory/scoped_ptr.h"
14 #include "base/time/time.h"
15
16 namespace cc {
17
18 // This class maintains a history of timestamps and rect IDs to communicate
19 // frame events back to Blink
20 // TODO(mpb): Start using this. crbug.com/442554
21 class FrameTimingTracker {
22 public:
23 struct CompositeTimingEvent {
24 CompositeTimingEvent(int, base::TimeTicks);
25 ~CompositeTimingEvent();
26
27 int frame_id;
28 base::TimeTicks timestamp;
29 };
30
31 using CompositeTimingSet =
32 base::hash_map<int, std::vector<CompositeTimingEvent>>;
33
34 static scoped_ptr<FrameTimingTracker> Create();
35
36 ~FrameTimingTracker();
37
38 // This routine takes all of the individual CompositeEvents stored in the
39 // tracker and collects them by "rect_id", as in the example below.
40 // [ {f_id1,r_id1,t1}, {f_id2,r_id1,t2}, {f_id3,r_id2,t3} ]
41 // ====>
42 // [ {r_id1,<{f_id1,t1},{f_id2,t2}>}, {r_id2,<{f_id3,t3}>} ]
43 scoped_ptr<CompositeTimingSet> GroupCountsByRectId();
44
45 // This routine takes a timestamp and an array of frame_id,rect_id pairs
46 // and generates CompositeTimingEvents (frame_id, timestamp) and adds them to
47 // internal hash_map keyed on rect_id
48 using FrameAndRectIds = std::pair<int, int64_t>;
49 void SaveTimeStamps(base::TimeTicks timestamp,
50 const std::vector<FrameAndRectIds>& frame_ids);
51
52 private:
53 FrameTimingTracker();
54
55 scoped_ptr<CompositeTimingSet> composite_events_;
56
57 DISALLOW_COPY_AND_ASSIGN(FrameTimingTracker);
58 };
59
60 } // namespace cc
61
62 #endif // CC_DEBUG_FRAME_TIMING_TRACKER_H_
OLDNEW
« no previous file with comments | « cc/debug/frame_timing_request.cc ('k') | cc/debug/frame_timing_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698