Commit 74b1ba65 authored by Sadrul Habib Chowdhury's avatar Sadrul Habib Chowdhury Committed by Commit Bot

[cc/metrics] Reset the dropped-frame counter on navigation.

The dropped-frame counter needs to be reset after navigation to avoid
showing (or reporting) dropped-frame count from the previous page.

BUG=1115376

Change-Id: Id9fd54df5fcaf31b6d69e7e7d1190ac29581b6df
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2366613
Auto-Submit: Sadrul Chowdhury <sadrul@chromium.org>
Reviewed-by: default avatarXida Chen <xidachen@chromium.org>
Commit-Queue: Sadrul Chowdhury <sadrul@chromium.org>
Cr-Commit-Position: refs/heads/master@{#800284}
parent 5178a2e3
...@@ -41,4 +41,11 @@ void DroppedFrameCounter::AddDroppedFrame() { ...@@ -41,4 +41,11 @@ void DroppedFrameCounter::AddDroppedFrame() {
++total_dropped_; ++total_dropped_;
} }
void DroppedFrameCounter::Reset() {
total_frames_ = 0;
total_partial_ = 0;
total_dropped_ = 0;
ring_buffer_.Clear();
}
} // namespace cc } // namespace cc
...@@ -43,6 +43,8 @@ class DroppedFrameCounter { ...@@ -43,6 +43,8 @@ class DroppedFrameCounter {
void AddPartialFrame(); void AddPartialFrame();
void AddDroppedFrame(); void AddDroppedFrame();
void Reset();
private: private:
RingBufferType ring_buffer_; RingBufferType ring_buffer_;
size_t total_frames_ = 0; size_t total_frames_ = 0;
......
...@@ -4822,6 +4822,7 @@ void LayerTreeHostImpl::SetActiveURL(const GURL& url, ukm::SourceId source_id) { ...@@ -4822,6 +4822,7 @@ void LayerTreeHostImpl::SetActiveURL(const GURL& url, ukm::SourceId source_id) {
ukm_manager_->SetSourceId(source_id); ukm_manager_->SetSourceId(source_id);
} }
total_frame_counter_.Reset(); total_frame_counter_.Reset();
dropped_frame_counter_.Reset();
} }
void LayerTreeHostImpl::AllocateLocalSurfaceId() { void LayerTreeHostImpl::AllocateLocalSurfaceId() {
......
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