0
Files
src/content/renderer
Thomas Lukaszewicz bbd83a20cf [discard] Ensure FrameTree::Discard clears service workers
This CL ensures that any service workers registered against a
discarded RenderFrameHostImpl are cleared following the a
discard operation.

Previously service workers were not being cleared as expected
because the commit params used to commit the new empty document
for discard copied over the service worker network provider
in DocumentLoader::CreateWebNavigationParamsToCloneDocument() [1].

As a result service workers could persist for the discarded frame
in the case the associated process was not proactively shut down.

This CL addresses this by clearing the ServiceWorkerNetworkProvider
when a discarded document is installed. This breaks the container
host pipe with the browser and the ServiceWorkerClient is
destroyed [2].

The ServiceWorkerNetworkProviderForFrame class lives in //content/
and must be replaced with
ServiceWorkerNetworkProviderForFrame::CreateInvalidInstance()
instead of being nullified in blink as the network provider is
expected to be not-null, see [3].

[1] https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/loader/document_loader.cc;l=743;drc=492dc9719f6e1845f4f5c0553cd5c7651115f671

[2] https://source.chromium.org/chromium/chromium/src/+/main:content/browser/service_worker/service_worker_context_core.cc;l=527;drc=492dc9719f6e1845f4f5c0553cd5c7651115f671

[3] https://source.chromium.org/chromium/chromium/src/+/main:content/renderer/render_frame_impl.cc;l=3045;drc=4c6d5b3c3ed16fa75258c6b4763188f840cb433d

Bug: 404877558
Change-Id: If0d495b94d4b5be38f2832152437a4b460f63692
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6367564
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Tom Lukaszewicz <tluk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1436434}
2025-03-22 00:16:54 -07:00
..
2025-03-21 07:38:19 -07:00
2024-10-31 19:37:21 +00:00
2024-11-08 21:56:14 +00:00
2024-09-11 15:27:54 +00:00