Ignore:
Timestamp:
Aug 19, 2019, 11:58:15 PM (6 years ago)
Author:
Devin Rousso
Message:

Web Inspector: Debugger: add a global breakpoint for pausing in the next microtask
https://bugs.webkit.org/show_bug.cgi?id=200652

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

  • inspector/protocol/Debugger.json:

Add setPauseOnMicrotasks command.

  • inspector/agents/InspectorDebuggerAgent.h:
  • inspector/agents/InspectorDebuggerAgent.cpp:

(Inspector::InspectorDebuggerAgent::disable):
(Inspector::InspectorDebuggerAgent::setPauseOnMicrotasks): Added.
(Inspector::InspectorDebuggerAgent::willRunMicrotask): Added.
(Inspector::InspectorDebuggerAgent::didRunMicrotask): Added.

  • debugger/Debugger.h:

(JSC::Debugger::willRunMicrotask): Added.
(JSC::Debugger::didRunMicrotask): Added.

  • inspector/ScriptDebugListener.h:
  • inspector/ScriptDebugServer.h:
  • inspector/ScriptDebugServer.cpp:

(Inspector::ScriptDebugServer::evaluateBreakpointAction):
(Inspector::ScriptDebugServer::sourceParsed):
(Inspector::ScriptDebugServer::willRunMicrotask): Added.
(Inspector::ScriptDebugServer::didRunMicrotask): Added.
(Inspector::ScriptDebugServer::canDispatchFunctionToListeners const): ADded.
(Inspector::ScriptDebugServer::dispatchFunctionToListeners): ADded.
(Inspector::ScriptDebugServer::handlePause):
(Inspector::ScriptDebugServer::dispatchDidPause): Deleted.
(Inspector::ScriptDebugServer::dispatchBreakpointActionLog): Deleted.
(Inspector::ScriptDebugServer::dispatchBreakpointActionSound): Deleted.
(Inspector::ScriptDebugServer::dispatchBreakpointActionProbe): Deleted.
(Inspector::ScriptDebugServer::dispatchDidContinue): Deleted.
(Inspector::ScriptDebugServer::dispatchDidParseSource): Deleted.
(Inspector::ScriptDebugServer::dispatchFailedToParseSource): Deleted.
Unify the various dispatch* functions to use lambdas so state management is centralized.

  • runtime/JSMicrotask.cpp:

(JSC::JSMicrotask::run):

  • inspector/agents/JSGlobalObjectDebuggerAgent.h:

Source/WebCore:

Test: inspector/debugger/setPauseOnMicrotasks.html

  • inspector/agents/page/PageDebuggerAgent.h:
  • inspector/agents/worker/WorkerDebuggerAgent.h:
  • inspector/agents/InspectorTimelineAgent.h:

(WebCore::InspectorTimelineAgent::willRunMicrotask): Added.
(WebCore::InspectorTimelineAgent::didRunMicrotask): Added.

Source/WebInspectorUI:

  • UserInterface/Controllers/DebuggerManager.js:

(WI.DebuggerManager):
(WI.DebuggerManager.prototype.initializeTarget):
(WI.DebuggerManager.prototype.get allMicrotasksBreakpoint): ADded.
(WI.DebuggerManager.prototype.isBreakpointSpecial):
(WI.DebuggerManager.prototype._pauseReasonFromPayload):
(WI.DebuggerManager.prototype._breakpointDisabledStateDidChange):

  • UserInterface/Views/DebuggerSidebarPanel.js:

(WI.DebuggerSidebarPanel):
(WI.DebuggerSidebarPanel.prototype.saveStateToCookie):
(WI.DebuggerSidebarPanel.prototype.restoreStateFromCookie):
(WI.DebuggerSidebarPanel.prototype._addBreakpoint):
(WI.DebuggerSidebarPanel.prototype._addTreeElement):
(WI.DebuggerSidebarPanel.prototype._updatePauseReasonSection):
(WI.DebuggerSidebarPanel.prototype._handleBreakpointElementAddedOrRemoved):
(WI.DebuggerSidebarPanel.prototype._populateCreateBreakpointContextMenu):

  • UserInterface/Views/SourcesNavigationSidebarPanel.js:

(WI.SourcesNavigationSidebarPanel):
(WI.SourcesNavigationSidebarPanel.prototype._insertDebuggerTreeElement):
(WI.SourcesNavigationSidebarPanel.prototype._addBreakpoint):
(WI.SourcesNavigationSidebarPanel.prototype._updatePauseReasonSection):
(WI.SourcesNavigationSidebarPanel.prototype._handleBreakpointElementAddedOrRemoved):
(WI.SourcesNavigationSidebarPanel.prototype._populateCreateBreakpointContextMenu):

  • UserInterface/Views/BreakpointTreeElement.css:

(.breakpoint-microtask-icon .icon): Added.

  • UserInterface/Images/Microtask.svg: Added.
  • UserInterface/Base/Setting.js:
  • Localizations/en.lproj/localizedStrings.js:

LayoutTests:

  • inspector/debugger/setPauseOnMicrotasks.html: Added.
  • inspector/debugger/setPauseOnMicrotasks-expected.txt: Added.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/debugger/Debugger.h

    r248762 r248894  
    123123
    124124    virtual void sourceParsed(ExecState*, SourceProvider*, int errorLineNumber, const WTF::String& errorMessage) = 0;
     125    virtual void willRunMicrotask() { }
     126    virtual void didRunMicrotask() { }
    125127
    126128    void exception(CallFrame*, JSValue exceptionValue, bool hasCatchHandler);
Note: See TracChangeset for help on using the changeset viewer.