Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6257)

Unified Diff: chrome/browser/page_load_metrics/observers/core_page_load_metrics_observer.cc

Issue 1817263003: Allow TimeTicks for serialized page load operations to be equal. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/page_load_metrics/observers/core_page_load_metrics_observer.cc
diff --git a/chrome/browser/page_load_metrics/observers/core_page_load_metrics_observer.cc b/chrome/browser/page_load_metrics/observers/core_page_load_metrics_observer.cc
index d4d6ea2cc84113efbccc819c87a53fbd9d1c9818..c808fe170859fcccc00e75861b681e37e423b7b6 100644
--- a/chrome/browser/page_load_metrics/observers/core_page_load_metrics_observer.cc
+++ b/chrome/browser/page_load_metrics/observers/core_page_load_metrics_observer.cc
@@ -137,7 +137,7 @@ void CorePageLoadMetricsObserver::RecordTimingHistograms(
if (info.started_in_foreground && !info.first_background_time.is_zero() &&
(timing.first_paint.is_zero() ||
timing.first_paint > info.first_background_time)) {
- if (!info.time_to_commit.is_zero()) {
+ if (info.committed) {
PAGE_LOAD_HISTOGRAM(internal::kHistogramBackgroundBeforePaint,
info.first_background_time);
} else {
@@ -158,10 +158,11 @@ void CorePageLoadMetricsObserver::RecordTimingHistograms(
// The rest of the histograms require the load to have committed and be
// relevant. If |timing.IsEmpty()|, then this load was not tracked by the
// renderer.
- if (info.time_to_commit.is_zero() || timing.IsEmpty())
+ if (!info.committed || timing.IsEmpty())
return;
- if (WasStartedInForegroundEventInForeground(info.time_to_commit, info)) {
+ if (info.started_in_foreground && (info.first_background_time.is_zero() ||
+ info.time_to_commit < info.first_background_time)) {
PAGE_LOAD_HISTOGRAM(internal::kHistogramCommit, info.time_to_commit);
} else {
PAGE_LOAD_HISTOGRAM(internal::kBackgroundHistogramCommit,
@@ -285,7 +286,7 @@ void CorePageLoadMetricsObserver::RecordRappor(
rappor::RapporService* rappor_service = g_browser_process->rappor_service();
if (!rappor_service)
return;
- if (info.time_to_commit.is_zero())
+ if (!info.committed)
return;
DCHECK(!info.committed_url.is_empty());
// Log the eTLD+1 of sites that show poor loading performance.

Powered by Google App Engine
This is Rietveld 408576698