Commit cfff8f5c authored by Sadrul Habib Chowdhury's avatar Sadrul Habib Chowdhury Committed by Commit Bot

[cc/metrics] Terminate reporters when begin-frames not expected.

If the client stops requesting begin-frames, then it is unlikely to
submit any compositor-frames for any begin-frame it may still be
handling. So terminate the associated reporters in this case.

BUG=790761

Change-Id: I2db257af67ea1827b97703280c12ab202b9be89e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2146785Reviewed-by: default avatarBehdad Bakhshinategh <behdadb@chromium.org>
Commit-Queue: Behdad Bakhshinategh <behdadb@chromium.org>
Auto-Submit: Sadrul Chowdhury <sadrul@chromium.org>
Cr-Commit-Position: refs/heads/master@{#758909}
parent 8be8f807
...@@ -296,6 +296,19 @@ void CompositorFrameReportingController::DidPresentCompositorFrame( ...@@ -296,6 +296,19 @@ void CompositorFrameReportingController::DidPresentCompositorFrame(
} }
} }
void CompositorFrameReportingController::OnStoppedRequestingBeginFrames() {
// If the client stopped requesting begin-frames, that means the begin-frames
// currently being handled are no longer expected to produce any
// compositor-frames. So terminate the reporters.
auto now = Now();
for (int i = 0; i < PipelineStage::kNumPipelineStages; ++i) {
if (reporters_[i]) {
reporters_[i]->TerminateFrame(FrameTerminationStatus::kDidNotProduceFrame,
now);
}
}
}
void CompositorFrameReportingController::SetBlinkBreakdown( void CompositorFrameReportingController::SetBlinkBreakdown(
std::unique_ptr<BeginMainFrameMetrics> details, std::unique_ptr<BeginMainFrameMetrics> details,
base::TimeTicks main_thread_start_time) { base::TimeTicks main_thread_start_time) {
......
...@@ -65,6 +65,7 @@ class CC_EXPORT CompositorFrameReportingController { ...@@ -65,6 +65,7 @@ class CC_EXPORT CompositorFrameReportingController {
virtual void DidPresentCompositorFrame( virtual void DidPresentCompositorFrame(
uint32_t frame_token, uint32_t frame_token,
const viz::FrameTimingDetails& details); const viz::FrameTimingDetails& details);
void OnStoppedRequestingBeginFrames();
void SetBlinkBreakdown(std::unique_ptr<BeginMainFrameMetrics> details, void SetBlinkBreakdown(std::unique_ptr<BeginMainFrameMetrics> details,
base::TimeTicks main_thread_start_time); base::TimeTicks main_thread_start_time);
......
...@@ -662,6 +662,7 @@ void CompositorTimingHistory::WillFinishImplFrame(bool needs_redraw, ...@@ -662,6 +662,7 @@ void CompositorTimingHistory::WillFinishImplFrame(bool needs_redraw,
void CompositorTimingHistory::BeginImplFrameNotExpectedSoon() { void CompositorTimingHistory::BeginImplFrameNotExpectedSoon() {
SetBeginMainFrameNeededContinuously(false); SetBeginMainFrameNeededContinuously(false);
SetCompositorDrawingContinuously(false); SetCompositorDrawingContinuously(false);
compositor_frame_reporting_controller_->OnStoppedRequestingBeginFrames();
} }
void CompositorTimingHistory::WillBeginMainFrame( void CompositorTimingHistory::WillBeginMainFrame(
......
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