diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-12 14:27:29 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-13 09:35:20 +0000 |
commit | c30a6232df03e1efbd9f3b226777b07e087a1122 (patch) | |
tree | e992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/components/page_load_metrics/common | |
parent | 7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff) | |
download | qtwebengine-chromium-85-based.tar.gz |
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/components/page_load_metrics/common')
3 files changed, 106 insertions, 16 deletions
diff --git a/chromium/components/page_load_metrics/common/page_end_reason.h b/chromium/components/page_load_metrics/common/page_end_reason.h index 94f3444267d..f6ab8eb2d36 100644 --- a/chromium/components/page_load_metrics/common/page_end_reason.h +++ b/chromium/components/page_load_metrics/common/page_end_reason.h @@ -15,7 +15,9 @@ namespace page_load_metrics { // numeric values should never be reused. For any additions, also update the // corresponding PageEndReason enum in enums.xml. enum PageEndReason { - // Page lifetime has not yet ended (page is still active). + // Page lifetime has not yet ended (page is still active). Pages that + // become hidden are logged in END_HIDDEN, so we expect low numbers in this + // bucket from the end of May 2020, i.e. in Navigation.PageEndReason2. END_NONE = 0, // The page was reloaded, possibly by the user. @@ -50,6 +52,10 @@ enum PageEndReason { // without committing, either without error or with net::ERR_ABORTED. END_OTHER = 9, + // The page became hidden but is still active. Added end of May 2020 for + // Navigation.PageEndReason2. + END_HIDDEN = 10, + PAGE_END_REASON_COUNT }; diff --git a/chromium/components/page_load_metrics/common/page_load_metrics.mojom b/chromium/components/page_load_metrics/common/page_load_metrics.mojom index c40451d875a..f4c41890dd2 100644 --- a/chromium/components/page_load_metrics/common/page_load_metrics.mojom +++ b/chromium/components/page_load_metrics/common/page_load_metrics.mojom @@ -19,6 +19,22 @@ struct DocumentTiming { mojo_base.mojom.TimeDelta? load_event_start; }; +struct LargestContentfulPaintTiming { + // Time when the page's largest image is painted. Removed images are excluded. + mojo_base.mojom.TimeDelta? largest_image_paint; + + // Size of the largest image of the largest image paint, by + // Size = Height * Width. Removed images are excluded. + uint64 largest_image_paint_size; + + // Time when the page's largest text is painted. Removed text is excluded. + mojo_base.mojom.TimeDelta? largest_text_paint; + + // Size of the largest text of the largest text paint, by + // Size = Height * Width. Removed text is excluded. + uint64 largest_text_paint_size; +}; + // TimeDeltas below relative to navigation start. struct PaintTiming { // Time when the first paint is performed. @@ -33,23 +49,23 @@ struct PaintTiming { // (Experimental) Time when the page's primary content is painted. mojo_base.mojom.TimeDelta? first_meaningful_paint; - // (Experimental) Time when the page's largest image is painted. - mojo_base.mojom.TimeDelta? largest_image_paint; + // Largest contentful paint, which excludes removed content. + LargestContentfulPaintTiming largest_contentful_paint; - // (Experimental) Size of the largest image of the largest image paint, by - // Size = Height * Width. - uint64 largest_image_paint_size; + // (Experimental) largest contentful paint including removed content. + LargestContentfulPaintTiming experimental_largest_contentful_paint; - // (Experimental) Time when the page's largest text is painted. - mojo_base.mojom.TimeDelta? largest_text_paint; - - // (Experimental) Size of the largest text of the largest text paint, by - // Size = Height * Width. - uint64 largest_text_paint_size; + // (Experimental) Time when the frame is first eligible to be painted, i.e. + // is first not render-throttled. Will be null if frame is throttled, + // unless there has already been a |first_paint|. + mojo_base.mojom.TimeDelta? first_eligible_to_paint; // (Experimental) Time when first input or scroll is received, causing the // largest contentful paint algorithm to stop. mojo_base.mojom.TimeDelta? first_input_or_scroll_notified_timestamp; + + // Time when the first paint happens after a portal activation. + mojo_base.mojom.TimeTicks? portal_activated_paint; }; // TimeDeltas below represent durations of time during the page load. @@ -105,6 +121,16 @@ struct InteractiveTiming { // The timestamp of the event whose delay is reported as longest_input_delay. mojo_base.mojom.TimeDelta? longest_input_timestamp; + + // The latency between user input and display update for the first scroll after + // a navigation. + mojo_base.mojom.TimeDelta? first_scroll_delay; + + // The timestamp of the user's first scroll after a navigation. + mojo_base.mojom.TimeDelta? first_scroll_timestamp; + + // The duration of event handlers processing the first input event. + mojo_base.mojom.TimeDelta? first_input_processing_time; }; // PageLoadTiming contains timing metrics associated with a page load. Many of @@ -124,6 +150,11 @@ struct PageLoadTiming { InteractiveTiming interactive_timing; PaintTiming paint_timing; ParseTiming parse_timing; + + // List of back-forward cache timings, one for each time a page was restored + // from the cache. + array<BackForwardCacheTiming> back_forward_cache_timings; + // Time between user input and navigation start. This is set for navigations // where the input start timing is known; currently when the navigation is // initiated by a link click in the renderer, or from the desktop omnibox. @@ -291,6 +322,21 @@ struct InputTiming { uint64 num_input_events = 0; }; +struct PercentOptional { + int8 percent; +}; + +// The throughput data for this page. +struct ThroughputUkmData { + // The source id for the ukm. + int64 source_id; + // The throughput of the page of different threads: main, compositor, and the + // aggregated throughput of main && compositor thread. + int8 aggregated_throughput_percent; + int8 impl_throughput_percent; + PercentOptional? main_throughput_percent; +}; + // Sent from renderer to browser process when the PageLoadTiming for the // associated frame changed. interface PageLoadMetrics { @@ -306,4 +352,24 @@ interface PageLoadMetrics { CpuTiming cpu_load_timing, DeferredResourceCounts new_deferred_resource_data, InputTiming input_timing_delta); + + // The renderer submit throughput data to the browser process. The browser + // process aggregates these data, and reports the aggregated value to UKM when + // the page shuts down or navigates away. + // TODO(xidachen): The interface exists for every frame, but this method is + // only called for LocalRoots. Should limit the visibility to LocalRoots only. + SubmitThroughputData(ThroughputUkmData throughput_data); +}; + +// TimeDelta below relative to the navigation start of the navigation restoring +// page from the back- forward cache. +struct BackForwardCacheTiming { + // Time when the first paint is performed after the time when the page + // is restored from the back-forward cache. + mojo_base.mojom.TimeDelta first_paint_after_back_forward_cache_restore; + + // Queueing Time of the first click, tap, key press, cancellable touchstart, + // or pointer down followed by a pointer up after the time when the page is + // restored from the back-forward cache. + mojo_base.mojom.TimeDelta? first_input_delay_after_back_forward_cache_restore; }; diff --git a/chromium/components/page_load_metrics/common/page_load_timing.cc b/chromium/components/page_load_metrics/common/page_load_timing.cc index 6ec07e64bb9..09eae81d8e9 100644 --- a/chromium/components/page_load_metrics/common/page_load_timing.cc +++ b/chromium/components/page_load_metrics/common/page_load_timing.cc @@ -10,7 +10,13 @@ mojom::PageLoadTimingPtr CreatePageLoadTiming() { return mojom::PageLoadTiming::New( base::Time(), base::Optional<base::TimeDelta>(), mojom::DocumentTiming::New(), mojom::InteractiveTiming::New(), - mojom::PaintTiming::New(), mojom::ParseTiming::New(), + mojom::PaintTiming::New(base::nullopt, base::nullopt, base::nullopt, + base::nullopt, + mojom::LargestContentfulPaintTiming::New(), + mojom::LargestContentfulPaintTiming::New(), + base::nullopt, base::nullopt, base::nullopt), + mojom::ParseTiming::New(), + std::vector<mojo::StructPtr<mojom::BackForwardCacheTiming>>{}, base::Optional<base::TimeDelta>()); } @@ -20,7 +26,9 @@ bool IsEmpty(const page_load_metrics::mojom::DocumentTiming& timing) { bool IsEmpty(const page_load_metrics::mojom::InteractiveTiming& timing) { return !timing.first_input_delay && !timing.first_input_timestamp && - !timing.longest_input_delay && !timing.longest_input_timestamp; + !timing.longest_input_delay && !timing.longest_input_timestamp && + !timing.first_scroll_delay && !timing.first_scroll_timestamp && + !timing.first_input_processing_time; } bool IsEmpty(const page_load_metrics::mojom::InputTiming& timing) { @@ -32,7 +40,11 @@ bool IsEmpty(const page_load_metrics::mojom::InputTiming& timing) { bool IsEmpty(const page_load_metrics::mojom::PaintTiming& timing) { return !timing.first_paint && !timing.first_image_paint && !timing.first_contentful_paint && !timing.first_meaningful_paint && - !timing.largest_image_paint && !timing.largest_text_paint; + !timing.largest_contentful_paint->largest_image_paint && + !timing.largest_contentful_paint->largest_text_paint && + !timing.experimental_largest_contentful_paint->largest_image_paint && + !timing.experimental_largest_contentful_paint->largest_text_paint && + !timing.first_eligible_to_paint; } bool IsEmpty(const page_load_metrics::mojom::ParseTiming& timing) { @@ -52,14 +64,20 @@ bool IsEmpty(const page_load_metrics::mojom::PageLoadTiming& timing) { (!timing.paint_timing || page_load_metrics::IsEmpty(*timing.paint_timing)) && (!timing.parse_timing || - page_load_metrics::IsEmpty(*timing.parse_timing)); + page_load_metrics::IsEmpty(*timing.parse_timing)) && + timing.back_forward_cache_timings.empty(); } void InitPageLoadTimingForTest(mojom::PageLoadTiming* timing) { timing->document_timing = mojom::DocumentTiming::New(); timing->interactive_timing = mojom::InteractiveTiming::New(); timing->paint_timing = mojom::PaintTiming::New(); + timing->paint_timing->largest_contentful_paint = + mojom::LargestContentfulPaintTiming::New(); + timing->paint_timing->experimental_largest_contentful_paint = + mojom::LargestContentfulPaintTiming::New(); timing->parse_timing = mojom::ParseTiming::New(); + timing->back_forward_cache_timings.clear(); } } // namespace page_load_metrics |