Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: c7cf80229641d15aad4f3a3e9dd76d6ab9a2e91f
https://github.com/WebKit/WebKit/commit/c7cf80229641d15aad4f3a3e9dd76d6ab9a2e91f
Author: Rodrigo Alencar <[email protected]>
Date: 2026-05-07 (Thu, 07 May 2026)
Changed paths:
M Source/WebCore/loader/FrameLoader.cpp
Log Message:
-----------
[Leak] Service worker fetch() retains ResourceResponses in the remote worker
DocumentLoader
https://bugs.webkit.org/show_bug.cgi?id=314187
Reviewed by Youenn Fablet.
Synthesized documents mark their FrameLoader state as Complete directly
instead of going through setState(FrameState::Complete). That bypasses the
normal DocumentLoader::stopRecordingResponses() call.
Remote worker pages used by service workers are initialized this way. When
service worker fetches go through their backing document loader,
each response can be recorded in DocumentLoader::m_responses even though the
document is already complete. This causes ResourceResponses to be retained for
the lifetime of the remote worker page.
Call stopRecordingResponses() when initializing synthesized documents so their
DocumentLoader matches the normal Complete state behavior.
No new automated test because this retention is only visible through native
WebContent memory inspection. The Web platform cannot observe
DocumentLoader::m_responses or m_stopRecordingResponses.
Manual test: ran a local WKWebView service worker fetch harness before and after
this change. Before: the remote worker DocumentLoader retained 5059 responses
and had m_stopRecordingResponses=false. After: the remote worker DocumentLoader
retained 0 responses and had m_stopRecordingResponses=true.
* Source/WebCore/loader/FrameLoader.cpp:
(WebCore::FrameLoader::initForSynthesizedDocument):
Canonical link: https://commits.webkit.org/312779@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications