Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 5b181eb9e164c0f6a82ee743963d97b8638da560
https://github.com/WebKit/WebKit/commit/5b181eb9e164c0f6a82ee743963d97b8638da560
Author: Qianlang Chen <[email protected]>
Date: 2026-07-08 (Wed, 08 Jul 2026)
Changed paths:
A
LayoutTests/http/tests/site-isolation/inspector/page/resources/fetch-body-with-json-string.txt
A
LayoutTests/http/tests/site-isolation/inspector/page/resources/iframe-with-text-fetch.html
A
LayoutTests/http/tests/site-isolation/inspector/page/search-in-resource-by-request-id-cross-origin-iframe-expected.txt
A
LayoutTests/http/tests/site-isolation/inspector/page/search-in-resource-by-request-id-cross-origin-iframe.html
A
LayoutTests/http/tests/site-isolation/inspector/page/search-in-resource-cross-origin-iframe-expected.txt
A
LayoutTests/http/tests/site-isolation/inspector/page/search-in-resource-cross-origin-iframe.html
A
LayoutTests/http/tests/site-isolation/inspector/page/search-in-resources-cross-origin-iframe-expected.txt
A
LayoutTests/http/tests/site-isolation/inspector/page/search-in-resources-cross-origin-iframe.html
M Source/JavaScriptCore/inspector/protocol/Page.json
M Source/WebCore/inspector/InspectorIdentifierRegistry.h
M Source/WebCore/inspector/InspectorResourceUtilities.h
M Source/WebCore/inspector/agents/InspectorPageAgent.cpp
M Source/WebCore/inspector/agents/InspectorPageAgent.h
M Source/WebKit/Scripts/webkit/messages.py
M Source/WebKit/Shared/InspectorPageTypes.serialization.in
M Source/WebKit/UIProcess/Inspector/Agents/ProxyingPageAgent.cpp
M Source/WebKit/UIProcess/Inspector/Agents/ProxyingPageAgent.h
M Source/WebKit/WebProcess/Inspector/BackendResourceDataStore.cpp
M Source/WebKit/WebProcess/Inspector/BackendResourceDataStore.h
M Source/WebKit/WebProcess/Inspector/FrameNetworkAgentProxy.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:
-----------
Web Inspector: Site Isolation: Page domain searchInResource /
searchInResources across processes
https://bugs.webkit.org/show_bug.cgi?id=309222
Reviewed by BJ Burg.
Under Site Isolation the inspected page's process no longer hosts
every frame's CachedResourceLoader, and the per-WebProcess
BackendResourceDataStore (the Site Isolation analog of
NetworkResourcesData) lives in each WebContent process. As a result
ProxyingPageAgent::searchInResource and
ProxyingPageAgent::searchInResources were stubs that returned empty
arrays, so global search and single-resource search found nothing for
any frame.
This implements both commands by fanning out to the WebContent
processes that host the page's frames and aggregating the results in
the UIProcess, mirroring the patterns already established by
getResourceTree (cross-process resource aggregation) and
getResponseBody (requestId routing):
- searchInResources groups every WebFrameProxy by its hosting
process and asks each process to search its frames' cached
resources together with its BackendResourceDataStore (XHR/Fetch)
in one round trip, then aggregates with a CallbackAggregator. This
consolidates the legacy Page->Network searchOtherRequests
cross-agent call, since both data sources live in the same
WebProcess under Site Isolation. Results are de-duplicated by URL
so a resource that is both a CachedResource and a buffered network
entry is reported once. This is a deliberate change from the
legacy path, which double-counts such a resource -- once in
InspectorPageAgent's own frame walk and again in
searchOtherRequests, which reaches it through the entry's retained
CachedResource. Reporting it once is the intended behavior under
Site Isolation.
- searchInResource routes to a single process: the requestId branch
parses the process-qualified protocol requestId to reach the
owning process's data store, and the frame+URL branch parses the
process-qualified protocol frameId to reach the frame's hosting
process.
Both commands become asynchronous (matching getResourceTree); the
legacy WebCore InspectorPageAgent implementations adopt the
async-callback form and answer synchronously. Results travel over
typed IPC via Inspector::SearchMatch and Inspector::SearchResult,
mirrors of the protocol types. BackendResourceDataStore entries now
carry a FrameIdentifier so XHR/Fetch search hits can be attributed to
the frame that originated them. Finally, the two protocol commands are
made available on the "web-page" target (the multiplexing backend
target the Site Isolation frontend talks to), not just the legacy
"page" target.
Tests:
http/tests/site-isolation/inspector/page/search-in-resource-by-request-id-cross-origin-iframe.html
http/tests/site-isolation/inspector/page/search-in-resource-cross-origin-iframe.html
http/tests/site-isolation/inspector/page/search-in-resources-cross-origin-iframe.html
*
LayoutTests/http/tests/site-isolation/inspector/page/resources/fetch-body-with-json-string.txt:
Added.
*
LayoutTests/http/tests/site-isolation/inspector/page/resources/iframe-with-text-fetch.html:
Added.
*
LayoutTests/http/tests/site-isolation/inspector/page/search-in-resource-by-request-id-cross-origin-iframe-expected.txt:
Added.
*
LayoutTests/http/tests/site-isolation/inspector/page/search-in-resource-by-request-id-cross-origin-iframe.html:
Added.
*
LayoutTests/http/tests/site-isolation/inspector/page/search-in-resource-cross-origin-iframe-expected.txt:
Added.
*
LayoutTests/http/tests/site-isolation/inspector/page/search-in-resource-cross-origin-iframe.html:
Added.
*
LayoutTests/http/tests/site-isolation/inspector/page/search-in-resources-cross-origin-iframe-expected.txt:
Added.
*
LayoutTests/http/tests/site-isolation/inspector/page/search-in-resources-cross-origin-iframe.html:
Added.
* Source/JavaScriptCore/inspector/protocol/Page.json:
* Source/WebCore/inspector/InspectorIdentifierRegistry.h:
(Inspector::IdentifierRegistry::parseProtocolFrameId):
* Source/WebCore/inspector/InspectorResourceUtilities.h:
* Source/WebCore/inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::searchInResource):
(WebCore::InspectorPageAgent::searchInResources):
* Source/WebCore/inspector/agents/InspectorPageAgent.h:
* Source/WebKit/Scripts/webkit/messages.py:
(types_that_cannot_be_forward_declared):
(headers_for_type):
* Source/WebKit/Shared/InspectorPageTypes.serialization.in:
* Source/WebKit/UIProcess/Inspector/Agents/ProxyingPageAgent.cpp:
(Inspector::ProxyingPageAgent::searchInResource):
(Inspector::ProxyingPageAgent::searchInResources):
* Source/WebKit/UIProcess/Inspector/Agents/ProxyingPageAgent.h:
* Source/WebKit/WebProcess/Inspector/BackendResourceDataStore.cpp:
(WebKit::BackendResourceDataStore::resourceCreated):
* Source/WebKit/WebProcess/Inspector/BackendResourceDataStore.h:
(WebKit::BackendResourceDataStore::ResourceData::frameID const):
(WebKit::BackendResourceDataStore::ResourceData::setFrameID):
(WebKit::BackendResourceDataStore::forEach const):
* Source/WebKit/WebProcess/Inspector/FrameNetworkAgentProxy.cpp:
(WebKit::FrameNetworkAgentProxy::willSendRequest):
(WebKit::FrameNetworkAgentProxy::willSendRequestOfType):
(WebKit::FrameNetworkAgentProxy::didLoadResourceFromMemoryCache):
* Source/WebKit/WebProcess/Inspector/WebInspectorBackend.cpp:
(WebKit::convertSearchMatches):
(WebKit::WebInspectorBackend::searchInRequest):
(WebKit::WebInspectorBackend::searchInFrameResource):
(WebKit::WebInspectorBackend::searchInFramesAndRequests):
* Source/WebKit/WebProcess/Inspector/WebInspectorBackend.h:
* Source/WebKit/WebProcess/Inspector/WebInspectorBackend.messages.in:
Canonical link: https://commits.webkit.org/316766@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications