Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 1fd298f8d706d1736b50f34c79d5b4bf32a32540
      
https://github.com/WebKit/WebKit/commit/1fd298f8d706d1736b50f34c79d5b4bf32a32540
  Author: Qianlang Chen <[email protected]>
  Date:   2025-10-14 (Tue, 14 Oct 2025)

  Changed paths:
    M Source/WebCore/inspector/FrameInspectorController.cpp
    M Source/WebCore/inspector/FrameInspectorController.h
    M Source/WebCore/inspector/InspectorController.h
    M Source/WebCore/inspector/InspectorInstrumentation.cpp
    M Source/WebCore/inspector/InspectorInstrumentation.h
    M Source/WebCore/inspector/InspectorWebAgentBase.h
    M Source/WebCore/inspector/InstrumentingAgents.cpp
    M Source/WebCore/inspector/InstrumentingAgents.h
    M Source/WebCore/page/LocalFrame.cpp
    M Source/WebCore/page/LocalFrame.h
    M Source/WebCore/page/Page.cpp

  Log Message:
  -----------
  [Site Isolation] Web Inspector: Register the frame target's agents for 
instrumentation
https://webkit.org/b/299607
rdar://161414130

Reviewed by BJ Burg.

This patch adds the registering and unregistering logic for the frame
target's agents. The plan is to slowly implement all agents of the
page target for the frame target, by mostly rewriting or moving them.
Given this anticipated transition, we also updated InstrumentingAgents
to allow the frame to use its page's agents as delegates replacing the
not yet implemented ones. This way, objects that interact with the
inspector or the inspector frontend can start viewing the frame as
having all agents that its page has, albeit without site isolation
support.

No new test as no new difference in behavior is expected.

* Source/WebCore/SaferCPPExpectations/ForwardDeclCheckerExpectations:
* Source/WebCore/inspector/FrameInspectorController.cpp:
(WebCore::FrameInspectorController::FrameInspectorController):
(WebCore::FrameInspectorController::frameAgentContext):
(WebCore::FrameInspectorController::connectFrontend):
(WebCore::FrameInspectorController::disconnectFrontend):
(WebCore::FrameInspectorController::inspectedFrameDestroyed):
* Source/WebCore/inspector/FrameInspectorController.h:
* Source/WebCore/inspector/InspectorController.h:
   Add support to use another set of InstrumentingAgents to fallback to.

* Source/WebCore/inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::instrumentingAgents):
* Source/WebCore/inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didClearWindowObjectInWorld):
(WebCore::InspectorInstrumentation::didAddOrRemoveScrollbars):
(WebCore::InspectorInstrumentation::frameWindowDiscarded):
(WebCore::InspectorInstrumentation::handleTouchEvent):
(WebCore::InspectorInstrumentation::handleMousePress):
(WebCore::InspectorInstrumentation::willPostMessage):
(WebCore::InspectorInstrumentation::didPostMessage):
(WebCore::InspectorInstrumentation::didFailPostMessage):
(WebCore::InspectorInstrumentation::willDispatchPostMessage):
(WebCore::InspectorInstrumentation::didDispatchPostMessage):
(WebCore::InspectorInstrumentation::willEvaluateScript):
(WebCore::InspectorInstrumentation::didEvaluateScript):
(WebCore::InspectorInstrumentation::didInvalidateLayout):
(WebCore::InspectorInstrumentation::willLayout):
(WebCore::InspectorInstrumentation::didLayout):
(WebCore::InspectorInstrumentation::willComposite):
(WebCore::InspectorInstrumentation::didComposite):
(WebCore::InspectorInstrumentation::willPaint):
(WebCore::InspectorInstrumentation::didPaint):
(WebCore::InspectorInstrumentation::applyUserAgentOverride):
(WebCore::InspectorInstrumentation::applyEmulatedMedia):
(WebCore::InspectorInstrumentation::flexibleBoxRendererBeganLayout):
(WebCore::InspectorInstrumentation::flexibleBoxRendererWrappedToNextLine):
(WebCore::InspectorInstrumentation::didReceiveResourceResponse):
(WebCore::InspectorInstrumentation::continueAfterXFrameOptionsDenied):
(WebCore::InspectorInstrumentation::continueWithPolicyDownload):
(WebCore::InspectorInstrumentation::continueWithPolicyIgnore):
(WebCore::InspectorInstrumentation::domContentLoadedEventFired):
(WebCore::InspectorInstrumentation::frameDetachedFromParent):
(WebCore::InspectorInstrumentation::didCommitLoad):
(WebCore::InspectorInstrumentation::frameDocumentUpdated):
(WebCore::InspectorInstrumentation::loaderDetachedFromFrame):
(WebCore::InspectorInstrumentation::frameStartedLoading):
(WebCore::InspectorInstrumentation::didCompleteRenderingFrame):
(WebCore::InspectorInstrumentation::frameStoppedLoading):
(WebCore::InspectorInstrumentation::shouldInterceptResponse):
(WebCore::InspectorInstrumentation::interceptResponse):
(WebCore::InspectorInstrumentation::addMessageToConsole):
(WebCore::InspectorInstrumentation::consoleCount):
(WebCore::InspectorInstrumentation::consoleCountReset):
(WebCore::InspectorInstrumentation::takeHeapSnapshot):
(WebCore::InspectorInstrumentation::startConsoleTiming):
(WebCore::InspectorInstrumentation::logConsoleTiming):
(WebCore::InspectorInstrumentation::stopConsoleTiming):
(WebCore::InspectorInstrumentation::consoleTimeStamp):
(WebCore::InspectorInstrumentation::startProfiling):
(WebCore::InspectorInstrumentation::stopProfiling):
(WebCore::InspectorInstrumentation::instrumentingAgents):
* Source/WebCore/inspector/InspectorWebAgentBase.h:
(WebCore::FrameAgentContext::FrameAgentContext):
   Register and unregister the frame's inspector agents, mimicking
   the page target's behavior for timing.

* Source/WebCore/inspector/InstrumentingAgents.cpp:
(WebCore::InstrumentingAgents::create):
(WebCore::InstrumentingAgents::InstrumentingAgents):
* Source/WebCore/inspector/InstrumentingAgents.h:
(WebCore::InstrumentingAgents::create): Deleted.
* Source/WebCore/page/LocalFrame.cpp:
(WebCore::LocalFrame::~LocalFrame):
(WebCore::LocalFrame::protectedInspectorController const):
(WebCore::LocalFrame::protectedInspectorController): Deleted.
   Since the frame now always has an InstrumentingAgents object, make
   its getter return a reference instead of pointer.

* Source/WebCore/page/LocalFrame.h:
* Source/WebCore/page/Page.cpp:
(WebCore::Page::didCompleteRenderingFrame):
   Adapt to the instrumentation function only accepting a LocalFrame,
   which was the behavior before the commit 
https://github.com/WebKit/WebKit/commit/a368459ce9a9e6b637a366dd90ba655f57031e23)

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to