0
Files
src/content/browser/attribution_reporting
Nan Lin 389716b783 Defer attribution reporting registrations from keepalive requests on prerendered pages
This only impacts keepalive requests when they're handled in the browser
process.

As prerendered pages are not visible to users yet, attribution reporting
registrations on prerendered pages should be deferred until activation.
This is the existing behavior when keepalive requests are handled in the
renderer process.

This cl introduces
`DocumentAssocidatedData::AddPostPrerenderingActivationStep()`, similar
to `blink::Document::AddPostPrerenderingActivationStep()`, to maintain a
queue of callbacks which will be invoked upon prerendered page
activation.

When the page is prerendering, the delegation of background registration
operations to `AttributionDataHostManager` will be added to the callback
queue for post-prerendering activation.

This cl also refactors the logic to invoke
`KeepAliveURLLoaderService::FactoryContext::OnDidCommitPrerenderedPageActivation()`.
When the navigation commits, a callback is added to the queue if the
page is prerendering.

The callbacks will be run for this RenderFrameHostImpl and all of its
descendants as all of them are activated. This fixes a bug that the UKM
source ID for the attribution context was not updated for subframes
within the prerendered page, and therefore no UKM metric was recorded.

Fixed: 395906295
Change-Id: Iede9a726571518a168175ef2c4c4e26957473157
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6293024
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Andrew Paseltiner <apaseltiner@chromium.org>
Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
Commit-Queue: Nan Lin <linnan@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1426591}
2025-02-28 14:59:23 -08:00
..
2025-01-22 12:42:12 -08:00