Commit 76374b52 authored by Hongbo Song's avatar Hongbo Song Committed by Commit Bot

Tentative fix for a Chrome crash bug.

According to Chrome crashes, |GetDelegate().GetPageInputTiming().total_input_delay| can be |std::numeric_limits<int64_t>::min()|. I still have not figured out why this value can be negative. But I think this CL can fix the chrome crash.

Change-Id: I8709239a9d96d240840f42a4b4ab661738651a53
Bug: 1105665
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2351379Reviewed-by: default avatarHongbo Song <hbsong@google.com>
Reviewed-by: default avatarSteve Kobes <skobes@chromium.org>
Commit-Queue: Hongbo Song <hbsong@google.com>
Cr-Commit-Position: refs/heads/master@{#798155}
parent 68dae9a9
...@@ -88,6 +88,10 @@ void ForegroundDurationUKMObserver::RecordUkmIfInForeground( ...@@ -88,6 +88,10 @@ void ForegroundDurationUKMObserver::RecordUkmIfInForeground(
void ForegroundDurationUKMObserver::RecordInputTimingMetrics( void ForegroundDurationUKMObserver::RecordInputTimingMetrics(
ukm::builders::PageForegroundSession* ukm_builder) { ukm::builders::PageForegroundSession* ukm_builder) {
// TODO(hbsong): crbug.com/1105665
if (GetDelegate().GetPageInputTiming().total_input_delay.InMilliseconds() < 0)
return;
ukm_builder ukm_builder
->SetForegroundNumInputEvents( ->SetForegroundNumInputEvents(
GetDelegate().GetPageInputTiming().num_input_events - GetDelegate().GetPageInputTiming().num_input_events -
...@@ -101,4 +105,4 @@ void ForegroundDurationUKMObserver::RecordInputTimingMetrics( ...@@ -101,4 +105,4 @@ void ForegroundDurationUKMObserver::RecordInputTimingMetrics(
last_page_input_timing_.total_adjusted_input_delay) last_page_input_timing_.total_adjusted_input_delay)
.InMilliseconds()); .InMilliseconds());
last_page_input_timing_ = GetDelegate().GetPageInputTiming(); last_page_input_timing_ = GetDelegate().GetPageInputTiming();
} }
\ No newline at end of file
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