Site Isolation Web Inspector: deterministic Network IDs, event routing
Web Inspector's getResponseBody now crosses Site Isolation process boundaries — routed by a frontend-controlled requestId string.
Source/WebCore/inspector/InspectorIdentifierRegistry.h
Source/WebInspectorUI/UserInterface/Controllers/NetworkManager.js
Web Inspector's Network domain is a page-level "octopus" domain: the frontend's NetworkManager maintains one unified resource list and frame tree, so events from all WebContent processes must be merged into a single coherent stream with globally non-colliding IDs. Previously, two resources in different processes could produce the same numeric ResourceLoaderIdentifier, causing silent aliasing in the Network panel.
This commit introduces deterministic frame/request/loader IDs encoded as "PID.OID" strings, upgrades ResourceLoaderIdentifier to a process-qualified ScopedResourceLoaderIdentifier, routes all cross-origin iframe Network events through ProxyingNetworkAgent, and fixes NetworkManager to lazily create stub frames and handle null loaderIdentifiers. PageNetworkAgent is disabled in WebContent processes under SI to prevent duplicate events for the main frame.
Significance
This is a significant Site Isolation infrastructure expansion that opens new IPC paths between untrusted WebContent processes and the inspector infrastructure in UIProcess, with process-qualified identifiers crossing privilege boundaries.
Audit directions
- Process-qualified ID bit-packing. The 1-arg
protocolFrameId(FrameIdentifier)overload usesframeID.toRawValue() >> 32for the upper bits andstatic_cast<uint32_t>(frameID.toRawValue())for the lower bits. If these extractions have edge cases at zero, max-value, or wrap-around, two logically distinct identifiers could produce the same string, silently aliasing resources in the frontend. - IPC trust boundary.
ScopedResourceLoaderIdentifierarrives over IPC from WebContent processes. If the deserialisation inProcessQualified.serialization.indoesn't validate that the carriedProcessIdentifiermatches the actual sender process, a compromised WebContent process could claim another process's PID and inject colliding or spoofed resource IDs into the inspector frontend. protocolLoaderIdfallback path (FIXME rdar://170087346). Falls back toIdentifiersFactorywhen the document is not yet available;loaderIdvalues are non-deterministic under race conditions, potentially causing frontend state corruption.- Lazy
WI.Framestub creation. A compromised WebContent process sending craftedframeIdentifiervalues could flood_frameIdentifierMapwith phantom frames or shadow existing frames. - SI gating on
siteIsolationFirstEnabled(). If SI is toggled mid-session,PageNetworkAgent::enable()'s early return could fire at the wrong time, leaving the agent in an inconsistent half-enabled state whileProxyingNetworkAgentis not yet listening.