Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d3afea7d89fd2b062ef39b644c3f026dc4904070
      
https://github.com/WebKit/WebKit/commit/d3afea7d89fd2b062ef39b644c3f026dc4904070
  Author: Qianlang Chen <[email protected]>
  Date:   2026-09-22 (Tue, 22 Sep 2026)

  Changed paths:
    A 
LayoutTests/http/tests/site-isolation/inspector/network/cross-origin-iframe-network-metrics-expected.txt
    A 
LayoutTests/http/tests/site-isolation/inspector/network/cross-origin-iframe-network-metrics.html
    A 
LayoutTests/http/tests/site-isolation/inspector/network/cross-origin-iframe-network-timing-expected.txt
    A 
LayoutTests/http/tests/site-isolation/inspector/network/cross-origin-iframe-network-timing.html
    M Source/WebCore/inspector/InspectorResourceUtilities.cpp
    M Source/WebCore/inspector/InspectorResourceUtilities.h
    M Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp
    M Source/WebCore/inspector/agents/InspectorNetworkAgent.h
    M Source/WebCore/platform/network/ResourceResponseBase.h
    M Source/WebKit/UIProcess/Inspector/Agents/ProxyingNetworkAgent.cpp
    M Source/WebKit/UIProcess/Inspector/Agents/ProxyingNetworkAgent.h
    M Source/WebKit/UIProcess/Inspector/Agents/ProxyingNetworkAgent.messages.in
    M Source/WebKit/WebProcess/Inspector/FrameNetworkAgentProxy.cpp

  Log Message:
  -----------
  [Site Isolation] Web Inspector: Network domain NetworkLoadMetrics via IPC
rdar://171758328
https://bugs.webkit.org/show_bug.cgi?id=308893

Reviewed by BJ Burg.

Network.loadingFinished passed nullptr for its metrics and
Network.Response carried no timing object: both are built in the
UIProcess, while the data behind them exists only in the WebContent
process. The frontend had no transfer sizes, no priority or connection
info, and no phase breakdown for any resource loaded under Site
Isolation.

No new serialization code was required. NetworkLoadMetrics and
AdditionalNetworkLoadMetricsForWebInspector are already coded, and a
response's own metrics already travel inside ResourceResponseData, so
Response.timing's inputs were reaching the UIProcess all along and were
being dropped. LoadingFinished gains a NetworkLoadMetrics, and
ResponseReceived gains the load's start time, the one input not already
on the wire because it lives on the ResourceLoader.

The builders that turn metrics into protocol objects moved from
InspectorNetworkAgent into ResourceUtilities so the in-process agent
and the UIProcess proxy cannot drift as the protocol evolves.
buildObjectForMetrics is timebase-independent and is shared verbatim;
buildObjectForTiming is not, so it now takes a converter and each
caller supplies its own timebase.

The in-process agent reports seconds elapsed on its
InspectorEnvironment's execution stopwatch. That cannot work here:
each FrameInspectorController creates its own, so times from two frames
share no epoch. This path reports raw monotonic seconds instead,
matching the convention the existing FrameNetworkAgentProxy timestamps
had already adopted implicitly.

FrameNetworkAgentProxy fetches the complete metrics from the
NetworkProcess when the instrumentation hook's copy is incomplete,
which is the common case in WebKit2, and takes the finish timestamp
from responseEnd rather than the current time, falling back to the
hook's copy when the NetworkProcess has no record for the identifier.
That synchronous fetch is issued directly, since frame network
instrumentation always runs on the main run loop.

Reading a response's timing in the UIProcess means going through
ResourceResponse::deprecatedNetworkLoadMetricsOrNull(), since that is
the only place the data arrives. The FIXME asking for metrics to be
taken off ResourceResponse had no bug tracking it, so this also puts
webkit.org/b/324751 on it. Nothing else about that cleanup changes
here.

Tests: 
http/tests/site-isolation/inspector/network/cross-origin-iframe-network-metrics.html
       
http/tests/site-isolation/inspector/network/cross-origin-iframe-network-timing.html

* 
LayoutTests/http/tests/site-isolation/inspector/network/cross-origin-iframe-network-metrics-expected.txt:
 Added.
* 
LayoutTests/http/tests/site-isolation/inspector/network/cross-origin-iframe-network-metrics.html:
 Added.
* 
LayoutTests/http/tests/site-isolation/inspector/network/cross-origin-iframe-network-timing-expected.txt:
 Added.
* 
LayoutTests/http/tests/site-isolation/inspector/network/cross-origin-iframe-network-timing.html:
 Added.
* Source/WebCore/inspector/InspectorResourceUtilities.cpp:
(Inspector::ResourceUtilities::buildObjectForHeaders):
(Inspector::ResourceUtilities::toProtocol):
(Inspector::ResourceUtilities::buildObjectForMetrics):
(Inspector::ResourceUtilities::buildObjectForTiming):
* Source/WebCore/inspector/InspectorResourceUtilities.h:
* Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::buildObjectForTiming):
(WebCore::buildObjectForResourceRequest):
(WebCore::InspectorNetworkAgent::buildObjectForResourceResponse):
(WebCore::InspectorNetworkAgent::didFinishLoading):
(WebCore::InspectorNetworkAgent::didSendWebSocketHandshakeRequest):
(WebCore::InspectorNetworkAgent::didReceiveWebSocketHandshakeResponse):
(WebCore::buildObjectForHeaders): Deleted.
(WebCore::InspectorNetworkAgent::buildObjectForMetrics): Deleted.
* Source/WebCore/inspector/agents/InspectorNetworkAgent.h:
* Source/WebKit/UIProcess/Inspector/Agents/ProxyingNetworkAgent.cpp:
(Inspector::buildObjectForResourceRequest):
(Inspector::monotonicTimeToProtocolSeconds):
(Inspector::buildObjectForResourceResponse):
(Inspector::ProxyingNetworkAgent::requestWillBeSent):
(Inspector::ProxyingNetworkAgent::responseReceived):
(Inspector::ProxyingNetworkAgent::loadingFinished):
(Inspector::ProxyingNetworkAgent::requestServedFromMemoryCache):
(Inspector::buildObjectForHeaders): Deleted.
* Source/WebKit/UIProcess/Inspector/Agents/ProxyingNetworkAgent.h:
* Source/WebKit/UIProcess/Inspector/Agents/ProxyingNetworkAgent.messages.in:
* Source/WebKit/WebProcess/Inspector/FrameNetworkAgentProxy.cpp:
(WebKit::FrameNetworkAgentProxy::didReceiveResponse):
(WebKit::FrameNetworkAgentProxy::didFinishLoading):
* Source/WebCore/platform/network/ResourceResponseBase.h:

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



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

Reply via email to