[webkit-changes] [WebKit/WebKit] 8a10ca: Web Inspector: Worker: support debugging `requestA...

Devin Rousso noreply at github.com
Tue Feb 11 17:17:38 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 8a10ca4b355df596fe94964ccd7e443d7f3180df
      https://github.com/WebKit/WebKit/commit/8a10ca4b355df596fe94964ccd7e443d7f3180df
  Author: Devin Rousso <hi at devinrousso.com>
  Date:   2025-02-11 (Tue, 11 Feb 2025)

  Changed paths:
    R LayoutTests/inspector/worker/dom-debugger-dom-breakpoints-expected.txt
    R LayoutTests/inspector/worker/dom-debugger-dom-breakpoints.html
    M LayoutTests/inspector/worker/dom-debugger-event-animation-frame-breakpoints-expected.txt
    M LayoutTests/inspector/worker/dom-debugger-event-animation-frame-breakpoints.html
    M LayoutTests/inspector/worker/resources/worker-dom-debugger.js
    M LayoutTests/platform/mac-site-isolation/TestExpectations
    M Source/JavaScriptCore/inspector/protocol/DOMDebugger.json
    M Source/WebCore/inspector/InspectorInstrumentation.cpp
    M Source/WebCore/inspector/InspectorInstrumentation.h
    M Source/WebCore/inspector/agents/InspectorDOMDebuggerAgent.cpp
    M Source/WebCore/inspector/agents/InspectorDOMDebuggerAgent.h
    M Source/WebCore/inspector/agents/WebDebuggerAgent.cpp
    M Source/WebCore/inspector/agents/WebDebuggerAgent.h
    M Source/WebCore/inspector/agents/page/PageDOMDebuggerAgent.cpp
    M Source/WebCore/inspector/agents/page/PageDOMDebuggerAgent.h
    M Source/WebCore/inspector/agents/page/PageDebuggerAgent.cpp
    M Source/WebCore/inspector/agents/page/PageDebuggerAgent.h
    M Source/WebCore/inspector/agents/worker/WorkerDOMDebuggerAgent.cpp
    M Source/WebCore/inspector/agents/worker/WorkerDOMDebuggerAgent.h
    M Source/WebCore/workers/WorkerAnimationController.cpp
    M Source/WebInspectorUI/UserInterface/Controllers/DOMDebuggerManager.js
    M Source/WebInspectorUI/UserInterface/Protocol/Legacy/iOS/13.4/InspectorBackendCommands.js
    M Source/WebInspectorUI/UserInterface/Protocol/Legacy/iOS/14.0/InspectorBackendCommands.js
    M Source/WebInspectorUI/UserInterface/Protocol/Legacy/iOS/14.5/InspectorBackendCommands.js
    M Source/WebInspectorUI/UserInterface/Protocol/Legacy/iOS/15.0/InspectorBackendCommands.js
    M Source/WebInspectorUI/UserInterface/Protocol/Legacy/iOS/15.4/InspectorBackendCommands.js
    M Source/WebInspectorUI/UserInterface/Protocol/Legacy/iOS/16.0/InspectorBackendCommands.js
    M Source/WebInspectorUI/UserInterface/Protocol/Legacy/iOS/16.4/InspectorBackendCommands.js
    M Source/WebInspectorUI/UserInterface/Protocol/Legacy/iOS/17.0/InspectorBackendCommands.js
    M Source/WebInspectorUI/UserInterface/Protocol/Legacy/iOS/17.2/InspectorBackendCommands.js
    M Source/WebInspectorUI/UserInterface/Protocol/Legacy/iOS/17.4/InspectorBackendCommands.js
    M Source/WebInspectorUI/UserInterface/Protocol/Legacy/iOS/18.0/InspectorBackendCommands.js
    M Source/WebInspectorUI/UserInterface/Protocol/Legacy/iOS/18.2/InspectorBackendCommands.js
    M Source/WebInspectorUI/UserInterface/Protocol/Legacy/macOS/13.0/InspectorBackendCommands.js
    M Source/WebInspectorUI/UserInterface/Protocol/Legacy/macOS/13.3/InspectorBackendCommands.js
    M Source/WebInspectorUI/UserInterface/Protocol/Legacy/macOS/14.0/InspectorBackendCommands.js
    M Source/WebInspectorUI/UserInterface/Protocol/Legacy/macOS/14.2/InspectorBackendCommands.js
    M Source/WebInspectorUI/UserInterface/Protocol/Legacy/macOS/14.4/InspectorBackendCommands.js
    M Source/WebInspectorUI/UserInterface/Protocol/Legacy/macOS/15.0/InspectorBackendCommands.js
    M Source/WebInspectorUI/UserInterface/Protocol/Legacy/macOS/15.2/InspectorBackendCommands.js
    M Source/WebInspectorUI/Versions/Inspector-iOS-13.4.json
    M Source/WebInspectorUI/Versions/Inspector-iOS-14.0.json
    M Source/WebInspectorUI/Versions/Inspector-iOS-14.5.json
    M Source/WebInspectorUI/Versions/Inspector-iOS-15.0.json
    M Source/WebInspectorUI/Versions/Inspector-iOS-15.4.json
    M Source/WebInspectorUI/Versions/Inspector-iOS-16.0.json
    M Source/WebInspectorUI/Versions/Inspector-iOS-16.4.json
    M Source/WebInspectorUI/Versions/Inspector-iOS-17.0.json
    M Source/WebInspectorUI/Versions/Inspector-iOS-17.2.json
    M Source/WebInspectorUI/Versions/Inspector-iOS-17.4.json
    M Source/WebInspectorUI/Versions/Inspector-iOS-18.0.json
    M Source/WebInspectorUI/Versions/Inspector-iOS-18.2.json
    M Source/WebInspectorUI/Versions/Inspector-macOS-13.0.json
    M Source/WebInspectorUI/Versions/Inspector-macOS-13.3.json
    M Source/WebInspectorUI/Versions/Inspector-macOS-14.0.json
    M Source/WebInspectorUI/Versions/Inspector-macOS-14.2.json
    M Source/WebInspectorUI/Versions/Inspector-macOS-14.4.json
    M Source/WebInspectorUI/Versions/Inspector-macOS-15.0.json
    M Source/WebInspectorUI/Versions/Inspector-macOS-15.2.json

  Log Message:
  -----------
  Web Inspector: Worker: support debugging `requestAnimationFrame`
https://bugs.webkit.org/show_bug.cgi?id=286667

Reviewed by BJ Burg.

It's now possible to call `requestAnimationFrame` from inside a `Worker`, so Web Inspector should be able to set breakpoints for and capture async stack traces from them.

* Source/WebCore/workers/WorkerAnimationController.cpp:
(WebCore::WorkerAnimationController::requestAnimationFrame):
(WebCore::WorkerAnimationController::cancelAnimationFrame):
(WebCore::WorkerAnimationController::serviceRequestAnimationFrameCallbacks):
Add `InspectorInstrumentation` hooks for when
- `requestAnimationFrame` is called
- `cancelAnimationFrame` is called
- an animation frame callback is about to be invoked
- an animation frame callback just finished invoking

* Source/WebCore/inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didRequestAnimationFrame):
(WebCore::InspectorInstrumentation::didCancelAnimationFrame):
(WebCore::InspectorInstrumentation::willFireAnimationFrame):
(WebCore::InspectorInstrumentation::didFireAnimationFrame):
* Source/WebCore/inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didRequestAnimationFrameImpl):
(WebCore::InspectorInstrumentation::didCancelAnimationFrameImpl):
(WebCore::InspectorInstrumentation::willFireAnimationFrameImpl):
(WebCore::InspectorInstrumentation::didFireAnimationFrameImpl):
Support both `Document` and `DedicatedWorkerGlobalScope`.

* Source/WebCore/inspector/agents/InspectorDOMDebuggerAgent.h:
* Source/WebCore/inspector/agents/InspectorDOMDebuggerAgent.cpp:
(WebCore::InspectorDOMDebuggerAgent::disable):
(WebCore::InspectorDOMDebuggerAgent::mainFrameNavigated):
(WebCore::InspectorDOMDebuggerAgent::setEventBreakpoint):
(WebCore::InspectorDOMDebuggerAgent::removeEventBreakpoint):
(WebCore::InspectorDOMDebuggerAgent::willFireAnimationFrame):
(WebCore::InspectorDOMDebuggerAgent::didFireAnimationFrame):
* Source/WebCore/inspector/agents/page/PageDOMDebuggerAgent.h:
* Source/WebCore/inspector/agents/page/PageDOMDebuggerAgent.cpp:
(WebCore::PageDOMDebuggerAgent::disable):
(WebCore::PageDOMDebuggerAgent::mainFrameNavigated):
(WebCore::PageDOMDebuggerAgent::willFireAnimationFrame): Deleted.
(WebCore::PageDOMDebuggerAgent::didFireAnimationFrame): Deleted.
(WebCore::PageDOMDebuggerAgent::setAnimationFrameBreakpoint): Deleted.
* Source/WebCore/inspector/agents/worker/WorkerDOMDebuggerAgent.h:
* Source/WebCore/inspector/agents/worker/WorkerDOMDebuggerAgent.cpp:
(WebCore::WorkerDOMDebuggerAgent::setAnimationFrameBreakpoint): Deleted.
Move all `m_pauseOnAllAnimationFramesBreakpoint` code to the base class so it can be used inside `Worker`.

* Source/WebCore/inspector/agents/WebDebuggerAgent.h:
* Source/WebCore/inspector/agents/WebDebuggerAgent.cpp:
(WebCore::WebDebuggerAgent::didRequestAnimationFrame):
(WebCore::WebDebuggerAgent::willFireAnimationFrame):
(WebCore::WebDebuggerAgent::didCancelAnimationFrame):
(WebCore::WebDebuggerAgent::didFireAnimationFrame):
* Source/WebCore/inspector/agents/page/PageDebuggerAgent.h:
* Source/WebCore/inspector/agents/page/PageDebuggerAgent.cpp:
(WebCore::PageDebuggerAgent::didRequestAnimationFrame): Deleted.
(WebCore::PageDebuggerAgent::willFireAnimationFrame): Deleted.
(WebCore::PageDebuggerAgent::didCancelAnimationFrame): Deleted.
(WebCore::PageDebuggerAgent::didFireAnimationFrame): Deleted.
Move all animation frame async stack trace capture code to the base class so it can be used inside `Worker`.

* Source/WebInspectorUI/UserInterface/Controllers/DOMDebuggerManager.js:
(WI.DOMDebuggerManager.prototype._supportsAllAnimationFramesBreakpoint): Added.
(WI.DOMDebuggerManager.prototype._setEventBreakpoint):
(WI.DOMDebuggerManager.prototype._removeEventBreakpoint):
Allow the "All Animation Frames" breakpoint to be set on `Worker` targets.

* LayoutTests/inspector/worker/resources/worker-dom-debugger.js:
(functions.triggerAnimationFrame): Added.
* LayoutTests/inspector/worker/dom-debugger-event-animation-frame-breakpoints.html:
* LayoutTests/inspector/worker/dom-debugger-event-animation-frame-breakpoints-expected.txt:

* Source/JavaScriptCore/inspector/protocol/DOMDebugger.json:
* Source/WebInspectorUI/UserInterface/Protocol/Legacy/iOS/13.4/InspectorBackendCommands.js:
* Source/WebInspectorUI/UserInterface/Protocol/Legacy/iOS/14.0/InspectorBackendCommands.js:
* Source/WebInspectorUI/UserInterface/Protocol/Legacy/iOS/14.5/InspectorBackendCommands.js:
* Source/WebInspectorUI/UserInterface/Protocol/Legacy/iOS/15.0/InspectorBackendCommands.js:
* Source/WebInspectorUI/UserInterface/Protocol/Legacy/iOS/15.4/InspectorBackendCommands.js:
* Source/WebInspectorUI/UserInterface/Protocol/Legacy/iOS/16.0/InspectorBackendCommands.js:
* Source/WebInspectorUI/UserInterface/Protocol/Legacy/iOS/16.4/InspectorBackendCommands.js:
* Source/WebInspectorUI/UserInterface/Protocol/Legacy/iOS/17.0/InspectorBackendCommands.js:
* Source/WebInspectorUI/UserInterface/Protocol/Legacy/iOS/17.2/InspectorBackendCommands.js:
* Source/WebInspectorUI/UserInterface/Protocol/Legacy/iOS/17.4/InspectorBackendCommands.js:
* Source/WebInspectorUI/UserInterface/Protocol/Legacy/iOS/18.0/InspectorBackendCommands.js:
* Source/WebInspectorUI/UserInterface/Protocol/Legacy/iOS/18.2/InspectorBackendCommands.js:
* Source/WebInspectorUI/UserInterface/Protocol/Legacy/macOS/13.0/InspectorBackendCommands.js:
* Source/WebInspectorUI/UserInterface/Protocol/Legacy/macOS/13.3/InspectorBackendCommands.js:
* Source/WebInspectorUI/UserInterface/Protocol/Legacy/macOS/14.0/InspectorBackendCommands.js:
* Source/WebInspectorUI/UserInterface/Protocol/Legacy/macOS/14.2/InspectorBackendCommands.js:
* Source/WebInspectorUI/UserInterface/Protocol/Legacy/macOS/14.4/InspectorBackendCommands.js:
* Source/WebInspectorUI/UserInterface/Protocol/Legacy/macOS/15.0/InspectorBackendCommands.js:
* Source/WebInspectorUI/UserInterface/Protocol/Legacy/macOS/15.2/InspectorBackendCommands.js:
* Source/WebInspectorUI/Versions/Inspector-iOS-13.4.json:
* Source/WebInspectorUI/Versions/Inspector-iOS-14.0.json:
* Source/WebInspectorUI/Versions/Inspector-iOS-14.5.json:
* Source/WebInspectorUI/Versions/Inspector-iOS-15.0.json:
* Source/WebInspectorUI/Versions/Inspector-iOS-15.4.json:
* Source/WebInspectorUI/Versions/Inspector-iOS-16.0.json:
* Source/WebInspectorUI/Versions/Inspector-iOS-16.4.json:
* Source/WebInspectorUI/Versions/Inspector-iOS-17.0.json:
* Source/WebInspectorUI/Versions/Inspector-iOS-17.2.json:
* Source/WebInspectorUI/Versions/Inspector-iOS-17.4.json:
* Source/WebInspectorUI/Versions/Inspector-iOS-18.0.json:
* Source/WebInspectorUI/Versions/Inspector-iOS-18.2.json:
* Source/WebInspectorUI/Versions/Inspector-macOS-13.0.json:
* Source/WebInspectorUI/Versions/Inspector-macOS-13.3.json:
* Source/WebInspectorUI/Versions/Inspector-macOS-14.0.json:
* Source/WebInspectorUI/Versions/Inspector-macOS-14.2.json:
* Source/WebInspectorUI/Versions/Inspector-macOS-14.4.json:
* Source/WebInspectorUI/Versions/Inspector-macOS-15.0.json:
* Source/WebInspectorUI/Versions/Inspector-macOS-15.2.json:
* LayoutTests/inspector/worker/dom-debugger-dom-breakpoints.html: Removed.
* LayoutTests/inspector/worker/dom-debugger-dom-breakpoints-expected.txt: Removed.
* LayoutTests/platform/mac-site-isolation/TestExpectations:

Drive-by: mark `DOMDebugger.setDOMBreakpoint` and `DOMDebugger.removeDOMBreakpoint` as being only supported by `"page"` targets since that's how the code behaves (i.e. it'll throw an error if dispatched to a `Worker`).
Canonical link: https://commits.webkit.org/290245@main



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


More information about the webkit-changes mailing list