Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 28b979b1659bca24e518a83cd0e55d8e8ed7a424
https://github.com/WebKit/WebKit/commit/28b979b1659bca24e518a83cd0e55d8e8ed7a424
Author: Qianlang Chen <[email protected]>
Date: 2026-07-27 (Mon, 27 Jul 2026)
Changed paths:
A
LayoutTests/http/tests/site-isolation/inspector/network/cross-origin-iframe-load-resource-expected.txt
A
LayoutTests/http/tests/site-isolation/inspector/network/cross-origin-iframe-load-resource.html
A
LayoutTests/http/tests/site-isolation/inspector/network/resources/load-resource-iframe.html
M Source/JavaScriptCore/inspector/protocol/Network.json
M Source/WebCore/inspector/InspectorResourceUtilities.cpp
M Source/WebCore/inspector/InspectorResourceUtilities.h
M Source/WebCore/inspector/InspectorThreadableLoaderClient.cpp
M Source/WebCore/inspector/InspectorThreadableLoaderClient.h
M Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp
M Source/WebInspectorUI/UserInterface/Controllers/NetworkManager.js
M Source/WebInspectorUI/UserInterface/Models/SourceMapResource.js
M Source/WebKit/Scripts/webkit/messages.py
M Source/WebKit/UIProcess/Inspector/Agents/ProxyingNetworkAgent.cpp
M Source/WebKit/WebProcess/Inspector/WebInspectorBackend.cpp
M Source/WebKit/WebProcess/Inspector/WebInspectorBackend.h
M Source/WebKit/WebProcess/Inspector/WebInspectorBackend.messages.in
Log Message:
-----------
[Site Isolation] Web Inspector: Implement Network.loadResource
https://bugs.webkit.org/show_bug.cgi?id=319019
rdar://181636193
Reviewed by BJ Burg.
Implement the ProxyingNetworkAgent::loadResource that was a stub.
Network.loadResource loads a URL in a frame's context on behalf of the
inspector (e.g. to fetch a source map). Unlike getResponseBody, which is
routed by a process-qualified requestId and returns already-buffered
content, loadResource is routed by frame (frameId + URL) and initiates a
load, so it needs frame -> process routing and a WebProcess-side load leg
rather than the requestId / BackendResourceDataStore path.
The WebProcess load leg reuses WebCore's InspectorThreadableLoaderClient,
refactored to report its result through a completion handler instead of a
LoadResourceCallback so it no longer depends on a backend dispatcher. It is
exposed behind a new shared ResourceUtilities::loadResource() helper that
owns the request/options and loader lifetime; the single-process
InspectorNetworkAgent now delegates to the same helper, so both paths share
one implementation.
On the UIProcess side, ProxyingNetworkAgent decodes the frame's hosting
process from the protocol frameId, the same way getResponseBody decodes it
from a requestId. It keeps getResponseBody's convention that an empty reply
error string means the WebProcess connection was lost (AsyncReplyError)
rather than a real failure.
Two supporting changes make the command reachable under Site Isolation:
Network.loadResource gains the "web-page" target type so it is exposed on
the multiplexing target where ProxyingNetworkAgent lives (without it the
frontend cannot call it there), and the two frontend callers route to the
backend target when Network is enabled there, mirroring the getResponseBody
reroute in Resource.requestContentFromBackend. Both are no-ops outside Site
Isolation.
Test:
http/tests/site-isolation/inspector/network/cross-origin-iframe-load-resource.html
*
LayoutTests/http/tests/site-isolation/inspector/network/cross-origin-iframe-load-resource-expected.txt:
Added.
*
LayoutTests/http/tests/site-isolation/inspector/network/cross-origin-iframe-load-resource.html:
Added.
*
LayoutTests/http/tests/site-isolation/inspector/network/resources/load-resource-iframe.html:
Added.
* Source/JavaScriptCore/inspector/protocol/Network.json:
* Source/WebCore/inspector/InspectorResourceUtilities.cpp:
(Inspector::ResourceUtilities::loadResource):
* Source/WebCore/inspector/InspectorResourceUtilities.h:
* Source/WebCore/inspector/InspectorThreadableLoaderClient.cpp:
(Inspector::InspectorThreadableLoaderClient::didFinishLoading):
(Inspector::InspectorThreadableLoaderClient::didFail):
(Inspector::InspectorThreadableLoaderClient::failWithMessage):
* Source/WebCore/inspector/InspectorThreadableLoaderClient.h:
* Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::loadResource):
* Source/WebInspectorUI/UserInterface/Controllers/NetworkManager.js:
(WI.NetworkManager.prototype._loadAndParseSourceMap):
* Source/WebInspectorUI/UserInterface/Models/SourceMapResource.js:
(WI.SourceMapResource.prototype.requestContentFromBackend):
* Source/WebKit/UIProcess/Inspector/Agents/ProxyingNetworkAgent.cpp:
(Inspector::ProxyingNetworkAgent::loadResource):
* Source/WebKit/WebProcess/Inspector/WebInspectorBackend.cpp:
(WebKit::WebInspectorBackend::loadResource):
* Source/WebKit/WebProcess/Inspector/WebInspectorBackend.h:
* Source/WebKit/WebProcess/Inspector/WebInspectorBackend.messages.in:
* Source/WebKit/Scripts/webkit/messages.py:
(class_template_headers):
Canonical link: https://commits.webkit.org/317996@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications