Commit f2ba2d6c authored by Robert Ogden's avatar Robert Ogden Committed by Commit Bot

Guard instead of DCHECKing in MaybeSetCompletedBeforeFCP

Looks like this DCHECK is failing once in a blue moon in testing, so it
probably is for users too. Change to just a simple guard so that the
metrics stay reliable.

Bug: 1027535
Change-Id: Ifda530b3dc880d1d23d58c1ba12f667ec4680799
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1931096Reviewed-by: default avatarCharlie Harrison <csharrison@chromium.org>
Commit-Queue: Robert Ogden <robertogden@chromium.org>
Cr-Commit-Position: refs/heads/master@{#718848}
parent 0324da10
...@@ -278,7 +278,17 @@ void MetricsRenderFrameObserver::MaybeSetCompletedBeforeFCP(int request_id) { ...@@ -278,7 +278,17 @@ void MetricsRenderFrameObserver::MaybeSetCompletedBeforeFCP(int request_id) {
const blink::WebPerformance& perf = const blink::WebPerformance& perf =
render_frame()->GetWebFrame()->Performance(); render_frame()->GetWebFrame()->Performance();
DCHECK_GT(base::Time::Now(), base::Time::FromDoubleT(perf.NavigationStart())); // Blink returns 0 if the performance metrics are unavailable. Check that
// navigation start is set to determine if performance metrics are
// available.
if (perf.NavigationStart() == 0)
return;
// This should not be possible, but none the less occasionally fails in edge
// case tests. Since we don't expect this to be valid, throw out this entry.
// See crbug.com/1027535.
if (base::Time::Now() < base::Time::FromDoubleT(perf.NavigationStart()))
return;
if (perf.FirstContentfulPaint() == 0) if (perf.FirstContentfulPaint() == 0)
before_fcp_request_ids_.insert(request_id); before_fcp_request_ids_.insert(request_id);
......
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