Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 65ee250042a1b2c540c5aa68095410b1024ab47a
https://github.com/WebKit/WebKit/commit/65ee250042a1b2c540c5aa68095410b1024ab47a
Author: Qianlang Chen <[email protected]>
Date: 2026-07-09 (Thu, 09 Jul 2026)
Changed paths:
A
LayoutTests/http/tests/site-isolation/inspector/network/resources/cacheable-resource.py
A
LayoutTests/http/tests/site-isolation/inspector/network/set-emulated-conditions-and-resource-caching-disabled-expected.txt
A
LayoutTests/http/tests/site-isolation/inspector/network/set-emulated-conditions-and-resource-caching-disabled.html
A
LayoutTests/http/tests/site-isolation/inspector/network/set-extra-http-headers-expected.txt
A
LayoutTests/http/tests/site-isolation/inspector/network/set-extra-http-headers.html
M Source/JavaScriptCore/inspector/protocol/Network.json
M Source/WebKit/UIProcess/Inspector/Agents/ProxyingNetworkAgent.cpp
M Source/WebKit/UIProcess/Inspector/Agents/ProxyingNetworkAgent.h
M Source/WebKit/WebProcess/Inspector/FrameNetworkAgentProxy.cpp
M Source/WebKit/WebProcess/Inspector/FrameNetworkAgentProxy.h
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: Network domain emulations/headers not
forwarded to web process
https://bugs.webkit.org/show_bug.cgi?id=318493
Reviewed by BJ Burg.
Under Site Isolation the per-WebProcess WebCore inspector agents
(InspectorNetworkAgent / PageNetworkAgent) early-return from enable(), so
they no longer hold or apply the Network domain's extra request headers or
the resource-caching-disabled flag. The UIProcess ProxyingNetworkAgent, the
only Network agent active under Site Isolation, stubbed setExtraHTTPHeaders,
setResourceCachingDisabled, and setEmulatedConditions. This re-hosts that
state in the Site Isolation classes.
setEmulatedConditions is applied session-wide at the NetworkSession level,
which is shared by every WebContent process of the page, so
ProxyingNetworkAgent (UIProcess) drives WebsiteDataStore directly with no
IPC, mirroring the legacy WebInspectorUIProxy::setEmulatedConditions hop.
setExtraHTTPHeaders and setResourceCachingDisabled need the WebProcess, so
each is a latch-and-fan-out on the UIProcess side: ProxyingNetworkAgent
stores the value and sends it to every WebContent process, and re-sends it
in enableInstrumentationForProcess() so processes that join later (process
swaps, new cross-origin iframes) pick up the current value. In the
WebProcess, WebInspectorBackend latches the value; the extra headers are
applied to the mutable outgoing request in
FrameNetworkAgentProxy::willSendRequest and willSendRequestOfType (each
proxy holds a reference to the shared map), and the caching flag is applied
to the process's Page.
On disable the latched state is reset in both processes, mirroring
InspectorNetworkAgent::disable(): ProxyingNetworkAgent outlives frontend
disconnect/reconnect so it must not leak stale headers into a later
frontend, and WebInspectorBackend must clear the Page's
resource-caching-disabled flag so it does not persist with no inspector
attached.
setExtraHTTPHeaders and setEmulatedConditions were gated to the "page"
target only, so they were not exposed on the "web-page" multiplexing target
where ProxyingNetworkAgent lives; both now also list "web-page".
setResourceCachingDisabled was already ungated.
setEmulatedConditions cannot be layout-tested because
ENABLE_INSPECTOR_NETWORK_THROTTLING is disabled by default. Its test
case is guarded on InspectorBackend.hasCommand() so it self-enables
once network throttling ships.
Tests:
http/tests/site-isolation/inspector/network/set-emulated-conditions-and-resource-caching-disabled.html
http/tests/site-isolation/inspector/network/set-extra-http-headers.html
*
LayoutTests/http/tests/site-isolation/inspector/network/resources/cacheable-resource.py:
Added.
*
LayoutTests/http/tests/site-isolation/inspector/network/set-emulated-conditions-and-resource-caching-disabled-expected.txt:
Added.
*
LayoutTests/http/tests/site-isolation/inspector/network/set-emulated-conditions-and-resource-caching-disabled.html:
Added.
*
LayoutTests/http/tests/site-isolation/inspector/network/set-extra-http-headers-expected.txt:
Added.
*
LayoutTests/http/tests/site-isolation/inspector/network/set-extra-http-headers.html:
Added.
* Source/JavaScriptCore/inspector/protocol/Network.json:
* Source/WebKit/UIProcess/Inspector/Agents/ProxyingNetworkAgent.cpp:
(Inspector::ProxyingNetworkAgent::enableInstrumentationForProcess):
(Inspector::ProxyingNetworkAgent::disable):
(Inspector::ProxyingNetworkAgent::setExtraHTTPHeaders):
(Inspector::ProxyingNetworkAgent::setResourceCachingDisabled):
(Inspector::ProxyingNetworkAgent::setEmulatedConditions):
* Source/WebKit/UIProcess/Inspector/Agents/ProxyingNetworkAgent.h:
* Source/WebKit/WebProcess/Inspector/FrameNetworkAgentProxy.cpp:
(WebKit::FrameNetworkAgentProxy::FrameNetworkAgentProxy):
(WebKit::FrameNetworkAgentProxy::willSendRequest):
(WebKit::FrameNetworkAgentProxy::willSendRequestOfType):
* Source/WebKit/WebProcess/Inspector/FrameNetworkAgentProxy.h:
* Source/WebKit/WebProcess/Inspector/WebInspectorBackend.cpp:
(WebKit::WebInspectorBackend::ensureNetworkInstrumentationForFrame):
(WebKit::WebInspectorBackend::disableNetworkInstrumentation):
(WebKit::WebInspectorBackend::setExtraHTTPHeaders):
(WebKit::WebInspectorBackend::setResourceCachingDisabled):
* Source/WebKit/WebProcess/Inspector/WebInspectorBackend.h:
* Source/WebKit/WebProcess/Inspector/WebInspectorBackend.messages.in:
Canonical link: https://commits.webkit.org/316819@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications