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

Side by Side Diff: cc/output/begin_frame_args.h

Issue 2583483002: [cc] Adds source_id and sequence_number to BeginFrameArgs. (Closed)
Patch Set: Created 4 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
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 CC_OUTPUT_BEGIN_FRAME_ARGS_H_ 5 #ifndef CC_OUTPUT_BEGIN_FRAME_ARGS_H_
6 #define CC_OUTPUT_BEGIN_FRAME_ARGS_H_ 6 #define CC_OUTPUT_BEGIN_FRAME_ARGS_H_
7 7
8 #include <stdint.h>
8 #include <memory> 9 #include <memory>
9 10
10 #include "base/location.h" 11 #include "base/location.h"
11 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
12 #include "base/time/time.h" 13 #include "base/time/time.h"
13 #include "base/values.h" 14 #include "base/values.h"
14 #include "cc/base/cc_export.h" 15 #include "cc/base/cc_export.h"
15 16
16 namespace base { 17 namespace base {
17 namespace trace_event { 18 namespace trace_event {
(...skipping 24 matching lines...) Expand all
42 enum BeginFrameArgsType { 43 enum BeginFrameArgsType {
43 INVALID, 44 INVALID,
44 NORMAL, 45 NORMAL,
45 MISSED, 46 MISSED,
46 // Not a real type, but used by the IPC system. Should always remain the 47 // Not a real type, but used by the IPC system. Should always remain the
47 // *last* value in this enum. 48 // *last* value in this enum.
48 BEGIN_FRAME_ARGS_TYPE_MAX, 49 BEGIN_FRAME_ARGS_TYPE_MAX,
49 }; 50 };
50 static const char* TypeToString(BeginFrameArgsType type); 51 static const char* TypeToString(BeginFrameArgsType type);
51 52
53 static const uint64_t kInvalidFrameNumber;
brianderson 2016/12/15 20:30:35 constexpr?
Eric Seckler 2016/12/16 17:25:57 Done.
54 static const uint64_t kStartingFrameNumber;
55
52 // Creates an invalid set of values. 56 // Creates an invalid set of values.
53 BeginFrameArgs(); 57 BeginFrameArgs();
54 58
55 #ifdef NDEBUG 59 #ifdef NDEBUG
56 typedef const void* CreationLocation; 60 typedef const void* CreationLocation;
57 #else 61 #else
58 typedef const tracked_objects::Location& CreationLocation; 62 typedef const tracked_objects::Location& CreationLocation;
59 tracked_objects::Location created_from; 63 tracked_objects::Location created_from;
60 #endif 64 #endif
61 65
62 // You should be able to find all instances where a BeginFrame has been 66 // You should be able to find all instances where a BeginFrame has been
63 // created by searching for "BeginFrameArgs::Create". 67 // created by searching for "BeginFrameArgs::Create".
64 // The location argument should **always** be BEGINFRAME_FROM_HERE macro. 68 // The location argument should **always** be BEGINFRAME_FROM_HERE macro.
65 static BeginFrameArgs Create(CreationLocation location, 69 static BeginFrameArgs Create(CreationLocation location,
70 uint32_t source_id,
71 uint64_t sequence_number,
66 base::TimeTicks frame_time, 72 base::TimeTicks frame_time,
67 base::TimeTicks deadline, 73 base::TimeTicks deadline,
68 base::TimeDelta interval, 74 base::TimeDelta interval,
69 BeginFrameArgsType type); 75 BeginFrameArgsType type);
70 76
71 // This is the default delta that will be used to adjust the deadline when 77 // This is the default delta that will be used to adjust the deadline when
72 // proper draw-time estimations are not yet available. 78 // proper draw-time estimations are not yet available.
73 static base::TimeDelta DefaultEstimatedParentDrawTime(); 79 static base::TimeDelta DefaultEstimatedParentDrawTime();
74 80
75 // This is the default interval to use to avoid sprinkling the code with 81 // This is the default interval to use to avoid sprinkling the code with
76 // magic numbers. 82 // magic numbers.
77 static base::TimeDelta DefaultInterval(); 83 static base::TimeDelta DefaultInterval();
78 84
79 bool IsValid() const { return interval >= base::TimeDelta(); } 85 bool IsValid() const { return interval >= base::TimeDelta(); }
80 86
81 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> AsValue() const; 87 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> AsValue() const;
82 void AsValueInto(base::trace_event::TracedValue* dict) const; 88 void AsValueInto(base::trace_event::TracedValue* dict) const;
83 89
90 // |source_id| and |sequence_number| identify a BeginFrame within a single
91 // process and are set by the original BeginFrameSource that created the
92 // BeginFrameArgs. When |source_id| of consecutive BeginFrameArgs changes,
93 // observers should expect the continuity of |sequence_number| to break.
94 uint32_t source_id;
Sami 2016/12/15 13:53:00 nit: move source_id toward the end to help with pa
Eric Seckler 2016/12/15 14:59:38 okay, moved both towards the end.
95 uint64_t sequence_number;
96
84 base::TimeTicks frame_time; 97 base::TimeTicks frame_time;
85 base::TimeTicks deadline; 98 base::TimeTicks deadline;
86 base::TimeDelta interval; 99 base::TimeDelta interval;
87 BeginFrameArgsType type; 100 BeginFrameArgsType type;
88 bool on_critical_path; 101 bool on_critical_path;
89 102
90 private: 103 private:
91 BeginFrameArgs(base::TimeTicks frame_time, 104 BeginFrameArgs(uint32_t source_id,
105 uint64_t sequence_number,
106 base::TimeTicks frame_time,
92 base::TimeTicks deadline, 107 base::TimeTicks deadline,
93 base::TimeDelta interval, 108 base::TimeDelta interval,
94 BeginFrameArgsType type); 109 BeginFrameArgsType type);
95 }; 110 };
96 111
97 } // namespace cc 112 } // namespace cc
98 113
99 #endif // CC_OUTPUT_BEGIN_FRAME_ARGS_H_ 114 #endif // CC_OUTPUT_BEGIN_FRAME_ARGS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698