Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: cc3ce348f900c719124ecd609ddc243dedc04731
      
https://github.com/WebKit/WebKit/commit/cc3ce348f900c719124ecd609ddc243dedc04731
  Author: Devin Rousso <[email protected]>
  Date:   2024-07-30 (Tue, 30 Jul 2024)

  Changed paths:
    A LayoutTests/inspector/debugger/resources/blackbox.js
    M LayoutTests/inspector/debugger/setBlackboxBreakpointEvaluations.html
    A 
LayoutTests/inspector/debugger/setShouldBlackboxURL-exact-case-insensitive-expected.txt
    A 
LayoutTests/inspector/debugger/setShouldBlackboxURL-exact-case-insensitive.html
    A 
LayoutTests/inspector/debugger/setShouldBlackboxURL-exact-case-sensitive-expected.txt
    A 
LayoutTests/inspector/debugger/setShouldBlackboxURL-exact-case-sensitive.html
    M LayoutTests/inspector/debugger/setShouldBlackboxURL-expected.txt
    A 
LayoutTests/inspector/debugger/setShouldBlackboxURL-regex-case-insensitive-expected.txt
    A 
LayoutTests/inspector/debugger/setShouldBlackboxURL-regex-case-insensitive.html
    A 
LayoutTests/inspector/debugger/setShouldBlackboxURL-regex-case-sensitive-expected.txt
    A 
LayoutTests/inspector/debugger/setShouldBlackboxURL-regex-case-sensitive.html
    M LayoutTests/inspector/debugger/setShouldBlackboxURL.html
    M Source/JavaScriptCore/debugger/Debugger.cpp
    M Source/JavaScriptCore/debugger/Debugger.h
    M Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp
    M Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h
    M Source/JavaScriptCore/inspector/protocol/Debugger.json
    M Source/WTF/wtf/text/OrdinalNumber.h
    M Source/WTF/wtf/text/TextPosition.h

  Log Message:
  -----------
  Web Inspector: Debugger: support blackboxing ranges within a file
https://bugs.webkit.org/show_bug.cgi?id=275552

Reviewed by Yusuke Suzuki.

This adds support for blackboxing source mapped resources since they (usually) 
only make up part(s) of the actual `.js` <https://webkit.org/b/275673>.

* Source/JavaScriptCore/inspector/protocol/Debugger.json:
* Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h:
* Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp:
(Inspector::blackboxRange): Added.
(Inspector::InspectorDebuggerAgent::internalEnable):
(Inspector::InspectorDebuggerAgent::setShouldBlackboxURL):
(Inspector::InspectorDebuggerAgent::setBlackboxConfiguration): Added.
(Inspector::InspectorDebuggerAgent::setPauseForInternalScripts):
(Inspector::InspectorDebuggerAgent::didParseSource):
(Inspector::InspectorDebuggerAgent::shouldBlackboxURL const): Deleted.
* Source/JavaScriptCore/debugger/Debugger.h:
* Source/JavaScriptCore/debugger/Debugger.cpp:
(JSC::Debugger::pauseIfNeeded):
(JSC::Debugger::setBlackboxConfiguration): Added.
(JSC::Debugger::clearBlackbox):
(JSC::Debugger::setBlackboxType): Deleted.
The blackbox configuration value is now another map of source range to blackbox 
options.
This allows for more than one range within the source file to be blackboxed.
It also supports each source range having a different behavior (which is never 
the case right now, but could be useful in the future).
Rather than just looking at the `SourceID` to decide whether to pause, also 
look at if the pause position is within any source range.

* Source/WTF/wtf/text/OrdinalNumber.h:
(WTF::DefaultHash<OrdinalNumber>::hash): Added.
(WTF::DefaultHash<OrdinalNumber>::equal): Added.
(WTF::HashTraits<OrdinalNumber>::constructDeletedValue): Added.
(WTF::HashTraits<OrdinalNumber>::isDeletedValue): Added.
(WTF::OrdinalNumber::operator> const): Deleted.
* Source/WTF/wtf/text/TextPosition.h:
(WTF::TextPosition::operator<=>): Added.
(WTF::DefaultHash<TextPosition>::hash): Added.
(WTF::DefaultHash<TextPosition>::equal): Added.
(WTF::HashTraits<TextPosition>::constructDeletedValue): Added.
(WTF::HashTraits<TextPosition>::isDeletedValue): Added.
Add comparison and hash functions so these can be used as keys in a `HashMap`.

* LayoutTests/inspector/debugger/resources/blackbox.js: Added.
(createScripts):
(ProtocolTest.Blackbox.setBlackbox):
(ProtocolTest.Blackbox.setBreakpoint):
(ProtocolTest.Blackbox.listenForSourceParsed):
(ProtocolTest.Blackbox.evaluate):
(ProtocolTest.Blackbox.pauseCountForFunction):
* LayoutTests/inspector/debugger/setShouldBlackboxURL.html:
* LayoutTests/inspector/debugger/setShouldBlackboxURL-expected.txt:
* 
LayoutTests/inspector/debugger/setShouldBlackboxURL-exact-case-insensitive.html:
 Added.
* 
LayoutTests/inspector/debugger/setShouldBlackboxURL-exact-case-insensitive-expected.txt:
 Added.
* 
LayoutTests/inspector/debugger/setShouldBlackboxURL-exact-case-sensitive.html: 
Added.
* 
LayoutTests/inspector/debugger/setShouldBlackboxURL-exact-case-sensitive-expected.txt:
 Added.
* 
LayoutTests/inspector/debugger/setShouldBlackboxURL-regex-case-insensitive.html:
 Added.
* 
LayoutTests/inspector/debugger/setShouldBlackboxURL-regex-case-insensitive-expected.txt:
 Added.
* 
LayoutTests/inspector/debugger/setShouldBlackboxURL-regex-case-sensitive.html: 
Added.
* 
LayoutTests/inspector/debugger/setShouldBlackboxURL-regex-case-sensitive-expected.txt:
 Added.
Split into multiple test files to avoid timeouts since there's so much 
pausing/stepping/etc..

* LayoutTests/inspector/debugger/setBlackboxBreakpointEvaluations.html:

Drive-by: remove unnecessary debugging flag.
Canonical link: https://commits.webkit.org/281634@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