Commit fd2cb104 authored by Xida Chen's avatar Xida Chen Committed by Commit Bot

[throughput] Track last frame

It could happen that after a BeginImpl(Main)Frame is reported, a tracker
is scheduled to terminate. In this case, any subsequent handling of
that impl(main)-frame will be lost. In other words, we completely lost
track of the last frame.

This CL fixes the impl frame, the fix for main frame comes later because
this CL is already big.

Bug: 1055844
Change-Id: I1cc65e9a5d973ecb67c83105be03f7bc08139dae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2079134
Commit-Queue: Xida Chen <xidachen@chromium.org>
Reviewed-by: default avatarRobert Flack <flackr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#752529}
parent adfc6824
This diff is collapsed.
......@@ -192,6 +192,8 @@ class CC_EXPORT FrameSequenceTrackerCollection {
ActiveFrameSequenceTrackers FrameSequenceTrackerActiveTypes();
FrameSequenceTracker* GetTrackerForTesting(FrameSequenceTrackerType type);
FrameSequenceTracker* GetRemovalTrackerForTesting(
FrameSequenceTrackerType type);
void SetUkmManager(UkmManager* manager);
......@@ -199,6 +201,8 @@ class CC_EXPORT FrameSequenceTrackerCollection {
friend class FrameSequenceTrackerTest;
void RecreateTrackers(const viz::BeginFrameArgs& args);
// Destroy the trackers that are ready to be terminated.
void DestroyTrackers();
const bool is_single_threaded_;
// The callsite can use the type to manipulate the tracker.
......@@ -227,9 +231,9 @@ class CC_EXPORT FrameSequenceTrackerCollection {
class CC_EXPORT FrameSequenceTracker {
public:
enum class TerminationStatus {
kActive,
kScheduledForTermination,
kReadyForTermination,
kActive = 0,
kScheduledForTermination = 1,
kReadyForTermination = 2,
};
static const char* GetFrameSequenceTrackerTypeName(
......@@ -435,9 +439,11 @@ class CC_EXPORT FrameSequenceTracker {
void Advance(base::TimeTicks new_timestamp);
} trace_data_;
#if DCHECK_IS_ON()
// True when an impl-impl is not ended. A tracker is ready for termination
// only when the last impl-frame is ended (ReportFrameEnd).
bool is_inside_frame_ = false;
#if DCHECK_IS_ON()
// This stringstream represents a sequence of frame reporting activities on
// the current tracker. Each letter can be one of the following:
// {'B', 'N', 'b', 'n', 'S', 'P'}, where
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment