Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 8e056fb08f560f5480e173eaf332c7ddae1fa5f3
      
https://github.com/WebKit/WebKit/commit/8e056fb08f560f5480e173eaf332c7ddae1fa5f3
  Author: Qianlang Chen <[email protected]>
  Date:   2026-07-24 (Fri, 24 Jul 2026)

  Changed paths:
    A 
LayoutTests/http/tests/site-isolation/inspector/network/cross-origin-iframe-get-response-body-after-navigation-expected.txt
    A 
LayoutTests/http/tests/site-isolation/inspector/network/cross-origin-iframe-get-response-body-after-navigation.html
    A 
LayoutTests/http/tests/site-isolation/inspector/network/cross-origin-iframe-get-response-body-after-process-crash-expected.txt
    A 
LayoutTests/http/tests/site-isolation/inspector/network/cross-origin-iframe-get-response-body-after-process-crash.html
    A 
LayoutTests/http/tests/site-isolation/inspector/network/cross-origin-iframe-get-response-body-error-cases-expected.txt
    A 
LayoutTests/http/tests/site-isolation/inspector/network/cross-origin-iframe-get-response-body-error-cases.html
    A 
LayoutTests/http/tests/site-isolation/inspector/network/cross-origin-iframe-get-response-body-expected.txt
    A 
LayoutTests/http/tests/site-isolation/inspector/network/cross-origin-iframe-get-response-body-via-request-content-expected.txt
    A 
LayoutTests/http/tests/site-isolation/inspector/network/cross-origin-iframe-get-response-body-via-request-content.html
    A 
LayoutTests/http/tests/site-isolation/inspector/network/cross-origin-iframe-get-response-body.html
    A 
LayoutTests/http/tests/site-isolation/inspector/network/resources/fetch-content-iframe.html
    A 
LayoutTests/http/tests/site-isolation/inspector/network/resources/get-response-body-iframe.html
    M Source/WebInspectorUI/UserInterface/Controllers/NetworkManager.js
    M Source/WebInspectorUI/UserInterface/Models/Resource.js
    M Source/WebKit/UIProcess/Inspector/Agents/ProxyingNetworkAgent.cpp
    M Source/WebKit/WebProcess/Inspector/BackendResourceDataStore.cpp
    M Source/WebKit/WebProcess/Inspector/BackendResourceDataStore.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: finish Network.getResponseBody
https://bugs.webkit.org/show_bug.cgi?id=318832
rdar://181048565

Reviewed by BJ Burg.

The core getResponseBody routing under Site Isolation (SI) landed earlier
in commit 313753@main (ProxyingNetworkAgent -> WebInspectorBackend ->
BackendResourceDataStore). This finishes the remaining work: adds success-
and error-path test coverage, and fixes two bugs that testing and manual
verification surfaced.

Bug 1 (backend, WebProcess crash): when the WebContent process that served
a resource is gone, IPC synthesizes the async reply from default-constructed
arguments (AsyncReplyError). The old three-value reply
(content, base64Encoded, errorString) then produced an empty errorString,
which a null String reports as isEmpty(), so ProxyingNetworkAgent misread a
dead process as an empty-body success. The reply is now
Expected<std::tuple<String, bool>, String>: a value is success, an unexpected
with a non-empty message is a real backend error, and an unexpected with an
empty message (only produced by AsyncReplyError on connection loss) is
reported as an explicit failure. A process-liveness check inside the reply
handler was rejected because it is racy: on a mid-request crash,
AuxiliaryProcessProxy::shutDownProcess() runs 
Connection::cancelAsyncReplyHandlers()
before clearing m_connection, so the process still reports state() == Running
when the reply runs. The structural discriminator is timing-independent.

Bug 2 (frontend, target routing): a resource's target defaults to
WI.mainTarget because the SI proxy sends an empty targetID, and under SI
WI.mainTarget is the page target. But the Network domain
(ProxyingNetworkAgent) lives on the multiplexing backend target, so the
UI content path (Resource.requestContent) issued getResponseBody on the
page target's legacy NetworkAgent, which does not know the resource's
cross-process requestId and answers "Missing resource for given
requestId". Resource.requestContentFromBackend now routes
getResponseBody to the backend target when it has Network enabled. The
gate is WI.networkManager.enabledNetworkForSiteIsolation (set when the
first Frame target appears and Network is enabled on the backend
target), not Target.hasDomain("Network"): hasDomain is statically true
on the WebPage-type backend target even when no Network agent is enabled
on it. Absent that agent (the single-process case) no Frame target is
created, so the flag stays false and the content path stays on the
resource's own target. The existing layout tests missed this because
they call WI.backendTarget.NetworkAgent directly; a new test drives the
real requestContent() path.

Scope notes: the requestId routing-trust hardening (a UIProcess-side
requestId -> process map instead of reverse-parsing the frontend string)
remains the existing FIXME in ProxyingNetworkAgent.cpp filed under bug 308890
(the same bug whose BackendResourceDataStore work landed in ccf6c82ad5c8); it
is intentionally left for that FIXME and does not block getResponseBody
working. Main-document content capture for cross-origin iframes is tracked by
bug 312828 (the main resource is classified ResourceType::Other); a parked
test for it is held for that change and is not included here. Memory-cache and
real-eviction layout coverage are descoped: the backend memory-cache path is
code-verified, but a deterministic layout-test trigger is unreliable.

Tests: 
http/tests/site-isolation/inspector/network/cross-origin-iframe-get-response-body-after-navigation.html
       
http/tests/site-isolation/inspector/network/cross-origin-iframe-get-response-body-after-process-crash.html
       
http/tests/site-isolation/inspector/network/cross-origin-iframe-get-response-body-error-cases.html
       
http/tests/site-isolation/inspector/network/cross-origin-iframe-get-response-body-via-request-content.html
       
http/tests/site-isolation/inspector/network/cross-origin-iframe-get-response-body.html

* 
LayoutTests/http/tests/site-isolation/inspector/network/cross-origin-iframe-get-response-body-after-navigation-expected.txt:
 Added.
* 
LayoutTests/http/tests/site-isolation/inspector/network/cross-origin-iframe-get-response-body-after-navigation.html:
 Added.
* 
LayoutTests/http/tests/site-isolation/inspector/network/cross-origin-iframe-get-response-body-after-process-crash-expected.txt:
 Added.
* 
LayoutTests/http/tests/site-isolation/inspector/network/cross-origin-iframe-get-response-body-after-process-crash.html:
 Added.
* 
LayoutTests/http/tests/site-isolation/inspector/network/cross-origin-iframe-get-response-body-error-cases-expected.txt:
 Added.
* 
LayoutTests/http/tests/site-isolation/inspector/network/cross-origin-iframe-get-response-body-error-cases.html:
 Added.
* 
LayoutTests/http/tests/site-isolation/inspector/network/cross-origin-iframe-get-response-body-expected.txt:
 Added.
* 
LayoutTests/http/tests/site-isolation/inspector/network/cross-origin-iframe-get-response-body-via-request-content-expected.txt:
 Added.
* 
LayoutTests/http/tests/site-isolation/inspector/network/cross-origin-iframe-get-response-body-via-request-content.html:
 Added.
* 
LayoutTests/http/tests/site-isolation/inspector/network/cross-origin-iframe-get-response-body.html:
 Added.
* 
LayoutTests/http/tests/site-isolation/inspector/network/resources/fetch-content-iframe.html:
 Added.
* 
LayoutTests/http/tests/site-isolation/inspector/network/resources/get-response-body-iframe.html:
 Added.
* Source/WebInspectorUI/UserInterface/Controllers/NetworkManager.js:
(WI.NetworkManager.prototype.get enabledNetworkForSiteIsolation):
* Source/WebInspectorUI/UserInterface/Models/Resource.js:
(WI.Resource.prototype.requestContentFromBackend):
* Source/WebKit/UIProcess/Inspector/Agents/ProxyingNetworkAgent.cpp:
(Inspector::ProxyingNetworkAgent::getResponseBody):
* Source/WebKit/WebProcess/Inspector/BackendResourceDataStore.cpp:
(WebKit::BackendResourceDataStore::getResponseBody):
* Source/WebKit/WebProcess/Inspector/BackendResourceDataStore.h:
* Source/WebKit/WebProcess/Inspector/WebInspectorBackend.cpp:
(WebKit::WebInspectorBackend::getResponseBody):
* Source/WebKit/WebProcess/Inspector/WebInspectorBackend.h:
* Source/WebKit/WebProcess/Inspector/WebInspectorBackend.messages.in:

Canonical link: https://commits.webkit.org/317908@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to