Changeset 251872 in webkit


Ignore:
Timestamp:
Oct 31, 2019 1:22:26 PM (5 years ago)
Author:
Devin Rousso
Message:

Web Inspector: Debugger: make sure the blackbox config is removed before iterating all existing scripts
https://bugs.webkit.org/show_bug.cgi?id=203666

Reviewed by Matt Baker.

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

(Inspector::InspectorDebuggerAgent::setShouldBlackboxURL):

Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r251855 r251872  
     12019-10-31  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: Debugger: make sure the blackbox config is removed before iterating all existing scripts
     4        https://bugs.webkit.org/show_bug.cgi?id=203666
     5
     6        Reviewed by Matt Baker.
     7
     8        * inspector/agents/InspectorDebuggerAgent.h:
     9        * inspector/agents/InspectorDebuggerAgent.cpp:
     10        (Inspector::InspectorDebuggerAgent::setShouldBlackboxURL):
     11
    1122019-10-31  Alex Christensen  <achristensen@webkit.org>
    213
  • trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp

    r251425 r251872  
    906906    }
    907907
     908    BlackboxConfig config { url, caseSensitive, isRegex };
    908909    if (shouldBlackbox)
    909         m_blackboxedURLs.append({ url, caseSensitive, isRegex });
     910        m_blackboxedURLs.appendIfNotContains(config);
     911    else
     912        m_blackboxedURLs.removeAll(config);
    910913
    911914    auto blackboxType = shouldBlackbox ? Optional<JSC::Debugger::BlackboxType>(JSC::Debugger::BlackboxType::Deferred) : WTF::nullopt;
     
    916919            continue;
    917920        m_scriptDebugServer.setBlackboxType(sourceID, blackboxType);
    918     }
    919 
    920     if (!shouldBlackbox) {
    921         m_blackboxedURLs.removeAllMatching([&] (const auto& blackboxConfig) {
    922             return blackboxConfig.url == url
    923                 && blackboxConfig.caseSensitive == caseSensitive
    924                 && blackboxConfig.isRegex == isRegex;
    925         });
    926921    }
    927922}
  • trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h

    r251425 r251872  
    193193        bool caseSensitive { false };
    194194        bool isRegex { false };
     195
     196        inline bool operator==(const BlackboxConfig& other) const
     197        {
     198            return url == other.url
     199                && caseSensitive == other.caseSensitive
     200                && isRegex == other.isRegex;
     201        }
    195202    };
    196203    Vector<BlackboxConfig> m_blackboxedURLs;
Note: See TracChangeset for help on using the changeset viewer.