Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 7ef0ccf4ec9d45eb384d6f734269d95b5db4bc62
https://github.com/WebKit/WebKit/commit/7ef0ccf4ec9d45eb384d6f734269d95b5db4bc62
Author: Sihui Liu <[email protected]>
Date: 2026-07-23 (Thu, 23 Jul 2026)
Changed paths:
M Source/WebKit/NetworkProcess/NetworkProcess.cpp
M Source/WebKit/NetworkProcess/NetworkProcess.h
M TestExpectations/apitests
Log Message:
-----------
NEW TEST(316740@main): [macOS]
TestWebKitAPI.PasteImage.PasteFileWhileNetworkProcessIsLaunching is a constant
failure
https://bugs.webkit.org/show_bug.cgi?id=319410
rdar://182236368
Reviewed by Abrar Rahman Protyasha.
When the NetworkProcess is relaunched (e.g. after being terminated), its
NetworkConnectionToWebProcess for a given WebProcess is created lazily, on
demand. If a paste of a
file happens right after the relaunch, WebPageProxy sends
AllowFilesAccessFromWebProcess to the
NetworkProcess before that connection exists.
NetworkProcess::allowFilesAccessFromWebProcess looked
up the connection, found none, and silently dropped the granted paths while
still reporting success
via the completion handler.
Shortly after, BlobRegistryProxy::registerInternalFileBlobURL (WebProcess side)
triggers lazy
creation of the NetworkConnectionToWebProcess and asks it to register the
file's blob URL. Because
the earlier grant was dropped, isFilePathAllowed() fails and the sandbox
extension consume fails
(sandbox_extension_consume failed: 1), so the file never gets exposed to the
page via
dataTransfer.files.
Fix by buffering pending file-access grants in a new NetworkProcess-level map
(m_pendingAllowedFilePathsByProcess) keyed by ProcessIdentifier, independent of
whether a live
NetworkConnectionToWebProcess exists yet. When
createNetworkConnectionToWebProcess later creates the
connection for that identifier, it drains and applies any pending paths, so the
grant is no longer
lost to the race. This mirrors the existing m_allowedFirstPartiesForCookies
buffering pattern used
for the same kind of race.
* Source/WebKit/NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
(WebKit::NetworkProcess::allowFilesAccessFromWebProcess):
* Source/WebKit/NetworkProcess/NetworkProcess.h:
* TestExpectations/apitests:
Canonical link: https://commits.webkit.org/317803@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications