| Index: chrome/browser/page_load_metrics/observers/service_worker_page_load_metrics_observer.cc
|
| diff --git a/chrome/browser/page_load_metrics/observers/service_worker_page_load_metrics_observer.cc b/chrome/browser/page_load_metrics/observers/service_worker_page_load_metrics_observer.cc
|
| index 8d12a74c8037a1c0339e28a8faf0d62ff88b696b..0811fe96efe8794ec4e3d1f988f47ea2cd2a94bd 100644
|
| --- a/chrome/browser/page_load_metrics/observers/service_worker_page_load_metrics_observer.cc
|
| +++ b/chrome/browser/page_load_metrics/observers/service_worker_page_load_metrics_observer.cc
|
| @@ -61,26 +61,26 @@ void ServiceWorkerPageLoadMetricsObserver::OnFirstContentfulPaint(
|
| const page_load_metrics::PageLoadExtraInfo& info) {
|
| if (!IsServiceWorkerControlled(info))
|
| return;
|
| - if (!WasStartedInForegroundEventInForeground(timing.first_contentful_paint,
|
| - info)) {
|
| + if (!WasStartedInForegroundOptionalEventInForeground(
|
| + timing.first_contentful_paint, info)) {
|
| PAGE_LOAD_HISTOGRAM(
|
| internal::kBackgroundHistogramServiceWorkerFirstContentfulPaint,
|
| - timing.first_contentful_paint);
|
| + timing.first_contentful_paint.value());
|
| return;
|
| }
|
| PAGE_LOAD_HISTOGRAM(internal::kHistogramServiceWorkerFirstContentfulPaint,
|
| - timing.first_contentful_paint);
|
| + timing.first_contentful_paint.value());
|
| PAGE_LOAD_HISTOGRAM(
|
| internal::kHistogramServiceWorkerParseStartToFirstContentfulPaint,
|
| - timing.first_contentful_paint - timing.parse_start);
|
| + timing.first_contentful_paint.value() - timing.parse_start.value());
|
|
|
| if (IsInboxSite(info.committed_url)) {
|
| PAGE_LOAD_HISTOGRAM(
|
| internal::kHistogramServiceWorkerFirstContentfulPaintInbox,
|
| - timing.first_contentful_paint);
|
| + timing.first_contentful_paint.value());
|
| PAGE_LOAD_HISTOGRAM(
|
| internal::kHistogramServiceWorkerParseStartToFirstContentfulPaintInbox,
|
| - timing.first_contentful_paint - timing.parse_start);
|
| + timing.first_contentful_paint.value() - timing.parse_start.value());
|
| }
|
| }
|
|
|
| @@ -89,15 +89,15 @@ void ServiceWorkerPageLoadMetricsObserver::OnDomContentLoadedEventStart(
|
| const page_load_metrics::PageLoadExtraInfo& info) {
|
| if (!IsServiceWorkerControlled(info))
|
| return;
|
| - if (!WasStartedInForegroundEventInForeground(
|
| + if (!WasStartedInForegroundOptionalEventInForeground(
|
| timing.dom_content_loaded_event_start, info)) {
|
| return;
|
| }
|
| PAGE_LOAD_HISTOGRAM(internal::kHistogramServiceWorkerDomContentLoaded,
|
| - timing.dom_content_loaded_event_start);
|
| + timing.dom_content_loaded_event_start.value());
|
| if (IsInboxSite(info.committed_url)) {
|
| PAGE_LOAD_HISTOGRAM(internal::kHistogramServiceWorkerDomContentLoadedInbox,
|
| - timing.dom_content_loaded_event_start);
|
| + timing.dom_content_loaded_event_start.value());
|
| }
|
| }
|
|
|
| @@ -106,12 +106,13 @@ void ServiceWorkerPageLoadMetricsObserver::OnLoadEventStart(
|
| const page_load_metrics::PageLoadExtraInfo& info) {
|
| if (!IsServiceWorkerControlled(info))
|
| return;
|
| - if (!WasStartedInForegroundEventInForeground(timing.load_event_start, info))
|
| + if (!WasStartedInForegroundOptionalEventInForeground(timing.load_event_start,
|
| + info))
|
| return;
|
| PAGE_LOAD_HISTOGRAM(internal::kHistogramServiceWorkerLoad,
|
| - timing.load_event_start);
|
| + timing.load_event_start.value());
|
| if (IsInboxSite(info.committed_url)) {
|
| PAGE_LOAD_HISTOGRAM(internal::kHistogramServiceWorkerLoadInbox,
|
| - timing.load_event_start);
|
| + timing.load_event_start.value());
|
| }
|
| }
|
|
|