<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[287232] trunk/Source</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/287232">287232</a></dd>
<dt>Author</dt> <dd>darin@apple.com</dd>
<dt>Date</dt> <dd>2021-12-18 15:57:08 -0800 (Sat, 18 Dec 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>Hash tables, read/write, and heap memory are used unnecessarily, which may hurt performance
https://bugs.webkit.org/show_bug.cgi?id=234438

Reviewed by Anders Carlsson.

Source/WebCore:

* Modules/mediacapabilities/MediaCapabilities.cpp:
(WebCore::bucketMIMETypes): Deleted.
(WebCore::isValidMediaMIMEType): Moved the code from bucketMIMETypes in here.
Use a SortedArraySet for bucketMIMETypes, which should be similar in performance
and uses no heap or read/write memory.

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::popupValue const): Use a loop to check the 5 valid
values here instead of making a HashSet. Should be similar in performance and
use no heap or read/write memory. Also removes call to convertToASCIILowercase,
which will also help performance and memory use a tiny bit in some cases.

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::inheritsPresentationalRole const): Use
decltype to make this declaration simpler and shorter.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateForEachEventHandlerContentAttribute): Use decltype and references
instead of pointers to make the function a little cleaner.

* dom/Element.cpp:
(WebCore::canAttachAuthorShadowRoot): Use constexpr so the tag list here does
not use any read/write memory.

* dom/make_names.pl:
(printFactoryCppFile): Removed the unnecessary constructors for the MapEntry
structs. Use decltype so we can make the tables constexpr so they do not use
any read/write memory.
(printWrapperFactoryCppFile): Ditto.

* editing/ReplaceSelectionCommand.cpp:
(WebCore::isProhibitedParagraphChild): Added a reserveInitialCapacity, which
could make the hash table here use a little less memory.

* html/Autofill.cpp:
(WebCore::fieldNameMap): Deleted. Replaced with a SortedArrayMap, which is
entirely made out of constexpr objcts so does not use heap or read/write memory.
(WebCore::toAutofillFieldName): Updated to use SortedArrayMap functions.
(WebCore::AutofillData::createFromHTMLFormControlElement): Ditto.

* html/HTMLDocument.cpp:
(WebCore::HTMLDocument::isCaseSensitiveAttribute): Added a reserveInitialCapacity,
which could make the hash table here use a little less memory.
* html/HTMLObjectElement.cpp:
(WebCore::preventsParentObjectFromExposure): Ditto.

* page/DebugPageOverlays.cpp:
(WebCore::touchEventRegionColors): Deleted.
(WebCore::NonFastScrollableRegionOverlay::drawRect): Use SortedArrayMap and
some lambdas to make this code tighter and easier to read.

* page/PerformanceUserTiming.cpp:
(WebCore::restrictedMarkNamesToNavigationTimingFunctionMap): Deleted. Use
a SortedArrayMap instead, which should be similar in performance and uses no heap
or read/write memory.
(WebCore::restrictedMarkFunction): Deleted.
(WebCore::isRestrictedMarkNameNonMainThread): Deleted. This is now safe to do on
any thread.
(WebCore::PerformanceUserTiming::isRestrictedMarkName): Use the SortedArrayMap,
which has the benefit of relaxing the thread restrictions; this is now safe to
call on any thread.
(WebCore::PerformanceUserTiming::convertMarkToTimestamp const): Updated to use
the SortedArrayMap. There may be some additional simplification possible now
that the mark functions map can be used in any thread, but I wasn't sure.

* platform/cocoa/RemoteCommandListenerCocoa.mm:
(WebCore::mediaRemoteCommandForPlatformCommand): Use makeOptionalFromPointer.

* platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::hasValidAverageCharWidth const): Use a SortedArraySet,
which should be similar in performance and uses no heap or read/write memory

* platform/graphics/FontPlatformData.cpp:
(WebCore::makeOptionalFromPointer): Deleted. Moved to SortedArrayMap.h.
* platform/graphics/HEVCUtilities.cpp:
(WebCore::makeOptionalFromPointer): Deleted. Moved to SortedArrayMap.h.

* platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm:
(WebCore::AVAssetMIMETypeCache::initializeCache): Updated for function name change.

* platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
Tweaked use of UNUSED_PARAM a bit across the file, relying on omitted names instead.

* platform/graphics/cg/UTIRegistry.cpp:
(WebCore::defaultSupportedImageTypes): Use a constexpr array rather than HashSet,
on something just iterating this, not using it as a set.

* platform/graphics/cocoa/SourceBufferParserWebM.cpp:
(WebCore::SourceBufferParserWebM::supportedMIMETypes): Renamed from webmMIMETypes,
changed to return a Span so we don't have to allocate a HashSet, since callers
simply iterate this, and don't do set operations.
(WebCore::SourceBufferParserWebM::isSupportedVideoCodec): Replaced the
supportedVideoCodecs with this. We don't need a HashSet to check for two values,
and this should be faster and use less memory.
(WebCore::SourceBufferParserWebM::isSupportedAudioCodec): Ditto.
* platform/graphics/cocoa/SourceBufferParserWebM.h: Updated for the changes above.

* rendering/svg/SVGResources.cpp:
(WebCore::tagSet): Added this helper to make the code in the functions below less
repetitive.
(WebCore::clipperFilterMaskerTags): Use a constexpr array instead of many separate
calls to HashSet::add to construct the set.
(WebCore::markerTags): Ditto.
(WebCore::fillAndStrokeTags): Ditto.
(WebCore::chainableResourceTags): Ditto.

Source/WebKit:

* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
(WebKit::ResourceLoadStatisticsDatabaseStore::sortedTables): Simplify unnecessarily complicated
expression to initialize the Span.

* Shared/Cocoa/DefaultWebBrowserChecks.h: Return a Span instead of an optional Vector.
* Shared/Cocoa/DefaultWebBrowserChecks.mm:
(WebKit::appBoundDomainsForTesting): Renamed from getAppBoundDomainsTesting to fit WebKit
coding style a bit better, and be a little more grammatical. Removed an un-needed HashMap
that had only a single entry, used a NeverDestroyed std::array rather than a Vector so we
don't use any heap or read/write memory.

* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::addTestDomains const): Rewrite to use the function above.
Fewer special cases needed since we are just using an empty Span, which efficiently
does nothing, so no need to have a distinct null value.

Source/WTF:

* wtf/SortedArrayMap.h:
(WTF::SortedArrayMap<ArrayType>::contains const): Added. More elegant than calling tryGet and
treating the pointer as a boolean.
(WTF::makeOptionalFromPointer): Moved here so it can be reused. Might rename later, since it's
only used in a few places.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFwtfSortedArrayMaph">trunk/Source/WTF/wtf/SortedArrayMap.h</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesmediacapabilitiesMediaCapabilitiescpp">trunk/Source/WebCore/Modules/mediacapabilities/MediaCapabilities.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityObjectcpp">trunk/Source/WebCore/accessibility/AccessibilityObject.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityRenderObjectcpp">trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCoredomElementcpp">trunk/Source/WebCore/dom/Element.cpp</a></li>
<li><a href="#trunkSourceWebCoredommake_namespl">trunk/Source/WebCore/dom/make_names.pl</a></li>
<li><a href="#trunkSourceWebCoreeditingReplaceSelectionCommandcpp">trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlAutofillcpp">trunk/Source/WebCore/html/Autofill.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLDocumentcpp">trunk/Source/WebCore/html/HTMLDocument.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLObjectElementcpp">trunk/Source/WebCore/html/HTMLObjectElement.cpp</a></li>
<li><a href="#trunkSourceWebCorepageDebugPageOverlayscpp">trunk/Source/WebCore/page/DebugPageOverlays.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePerformanceUserTimingcpp">trunk/Source/WebCore/page/PerformanceUserTiming.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformcocoaRemoteCommandListenerCocoamm">trunk/Source/WebCore/platform/cocoa/RemoteCommandListenerCocoa.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontCascadecpp">trunk/Source/WebCore/platform/graphics/FontCascade.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontPlatformDatacpp">trunk/Source/WebCore/platform/graphics/FontPlatformData.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsHEVCUtilitiescpp">trunk/Source/WebCore/platform/graphics/HEVCUtilities.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcAVAssetMIMETypeCachemm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcCDMInstanceFairPlayStreamingAVFObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgUTIRegistrycpp">trunk/Source/WebCore/platform/graphics/cg/UTIRegistry.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscocoaSourceBufferParserWebMcpp">trunk/Source/WebCore/platform/graphics/cocoa/SourceBufferParserWebM.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscocoaSourceBufferParserWebMh">trunk/Source/WebCore/platform/graphics/cocoa/SourceBufferParserWebM.h</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgSVGResourcescpp">trunk/Source/WebCore/rendering/svg/SVGResources.cpp</a></li>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessClassifierResourceLoadStatisticsDatabaseStorecpp">trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp</a></li>
<li><a href="#trunkSourceWebKitSharedCocoaDefaultWebBrowserChecksh">trunk/Source/WebKit/Shared/Cocoa/DefaultWebBrowserChecks.h</a></li>
<li><a href="#trunkSourceWebKitSharedCocoaDefaultWebBrowserChecksmm">trunk/Source/WebKit/Shared/Cocoa/DefaultWebBrowserChecks.mm</a></li>
<li><a href="#trunkSourceWebKitUIProcessWebsiteDataCocoaWebsiteDataStoreCocoamm">trunk/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (287231 => 287232)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog       2021-12-18 22:50:04 UTC (rev 287231)
+++ trunk/Source/WTF/ChangeLog  2021-12-18 23:57:08 UTC (rev 287232)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2021-12-18  Darin Adler  <darin@apple.com>
+
+        Hash tables, read/write, and heap memory are used unnecessarily, which may hurt performance
+        https://bugs.webkit.org/show_bug.cgi?id=234438
+
+        Reviewed by Anders Carlsson.
+
+        * wtf/SortedArrayMap.h:
+        (WTF::SortedArrayMap<ArrayType>::contains const): Added. More elegant than calling tryGet and
+        treating the pointer as a boolean.
+        (WTF::makeOptionalFromPointer): Moved here so it can be reused. Might rename later, since it's
+        only used in a few places.
+
</ins><span class="cx"> 2021-12-17  Simon Fraser  <simon.fraser@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Read the default value of the ScrollAnimatorEnabled setting from NSUserDefaults
</span></span></pre></div>
<a id="trunkSourceWTFwtfSortedArrayMaph"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/SortedArrayMap.h (287231 => 287232)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/SortedArrayMap.h    2021-12-18 22:50:04 UTC (rev 287231)
+++ trunk/Source/WTF/wtf/SortedArrayMap.h       2021-12-18 23:57:08 UTC (rev 287232)
</span><span class="lines">@@ -51,6 +51,7 @@
</span><span class="cx">     using ValueType = typename ElementType::second_type;
</span><span class="cx"> 
</span><span class="cx">     constexpr SortedArrayMap(const ArrayType&);
</span><ins>+    template<typename KeyArgument> bool contains(const KeyArgument&) const;
</ins><span class="cx"> 
</span><span class="cx">     // FIXME: To match HashMap interface better, would be nice to get the default value from traits.
</span><span class="cx">     template<typename KeyArgument> ValueType get(const KeyArgument&, const ValueType& defaultValue = { }) const;
</span><span class="lines">@@ -77,7 +78,7 @@
</span><span class="cx"> 
</span><span class="cx"> // NoUppercaseLettersOptimized means no characters with the 0x20 bit set.
</span><span class="cx"> // That means the strings can't include control characters, uppercase letters, or any of @[\]_.
</span><del>-enum class ASCIISubset { All, NoUppercaseLetters, NoUppercaseLettersOptimized };
</del><ins>+enum class ASCIISubset : uint8_t { All, NoUppercaseLetters, NoUppercaseLettersOptimized };
</ins><span class="cx"> 
</span><span class="cx"> template<ASCIISubset> struct ComparableASCIISubsetLiteral {
</span><span class="cx">     ASCIILiteral literal;
</span><span class="lines">@@ -189,6 +190,11 @@
</span><span class="cx">     return result ? *result : defaultValue;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+template<typename ArrayType> template<typename KeyArgument> inline bool SortedArrayMap<ArrayType>::contains(const KeyArgument& key) const
+{
+    return tryGet(key);
+}
+
</ins><span class="cx"> template<typename ArrayType> constexpr SortedArraySet<ArrayType>::SortedArraySet(const ArrayType& array)
</span><span class="cx">     : m_array { array }
</span><span class="cx"> {
</span><span class="lines">@@ -365,8 +371,15 @@
</span><span class="cx">     return a.value() < b.value();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+template<typename ValueType> constexpr std::optional<ValueType> makeOptionalFromPointer(const ValueType* pointer)
+{
+    if (!pointer)
+        return std::nullopt;
+    return *pointer;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+}
+
</ins><span class="cx"> // FIXME: Rename the Comparable and Packed types for clarity and to align them better with each other.
</span><span class="cx"> using WTF::ASCIISubset;
</span><span class="cx"> using WTF::ComparableASCIILiteral;
</span><span class="lines">@@ -376,3 +389,4 @@
</span><span class="cx"> using WTF::PackedASCIILowerCodes;
</span><span class="cx"> using WTF::SortedArrayMap;
</span><span class="cx"> using WTF::SortedArraySet;
</span><ins>+using WTF::makeOptionalFromPointer;
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (287231 => 287232)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2021-12-18 22:50:04 UTC (rev 287231)
+++ trunk/Source/WebCore/ChangeLog      2021-12-18 23:57:08 UTC (rev 287232)
</span><span class="lines">@@ -1,3 +1,116 @@
</span><ins>+2021-12-18  Darin Adler  <darin@apple.com>
+
+        Hash tables, read/write, and heap memory are used unnecessarily, which may hurt performance
+        https://bugs.webkit.org/show_bug.cgi?id=234438
+
+        Reviewed by Anders Carlsson.
+
+        * Modules/mediacapabilities/MediaCapabilities.cpp:
+        (WebCore::bucketMIMETypes): Deleted.
+        (WebCore::isValidMediaMIMEType): Moved the code from bucketMIMETypes in here.
+        Use a SortedArraySet for bucketMIMETypes, which should be similar in performance
+        and uses no heap or read/write memory.
+
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::AccessibilityObject::popupValue const): Use a loop to check the 5 valid
+        values here instead of making a HashSet. Should be similar in performance and
+        use no heap or read/write memory. Also removes call to convertToASCIILowercase,
+        which will also help performance and memory use a tiny bit in some cases.
+
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::inheritsPresentationalRole const): Use
+        decltype to make this declaration simpler and shorter.
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateForEachEventHandlerContentAttribute): Use decltype and references
+        instead of pointers to make the function a little cleaner.
+
+        * dom/Element.cpp:
+        (WebCore::canAttachAuthorShadowRoot): Use constexpr so the tag list here does
+        not use any read/write memory.
+
+        * dom/make_names.pl:
+        (printFactoryCppFile): Removed the unnecessary constructors for the MapEntry
+        structs. Use decltype so we can make the tables constexpr so they do not use
+        any read/write memory.
+        (printWrapperFactoryCppFile): Ditto.
+
+        * editing/ReplaceSelectionCommand.cpp:
+        (WebCore::isProhibitedParagraphChild): Added a reserveInitialCapacity, which
+        could make the hash table here use a little less memory.
+
+        * html/Autofill.cpp:
+        (WebCore::fieldNameMap): Deleted. Replaced with a SortedArrayMap, which is
+        entirely made out of constexpr objcts so does not use heap or read/write memory.
+        (WebCore::toAutofillFieldName): Updated to use SortedArrayMap functions.
+        (WebCore::AutofillData::createFromHTMLFormControlElement): Ditto.
+
+        * html/HTMLDocument.cpp:
+        (WebCore::HTMLDocument::isCaseSensitiveAttribute): Added a reserveInitialCapacity,
+        which could make the hash table here use a little less memory.
+        * html/HTMLObjectElement.cpp:
+        (WebCore::preventsParentObjectFromExposure): Ditto.
+
+        * page/DebugPageOverlays.cpp:
+        (WebCore::touchEventRegionColors): Deleted.
+        (WebCore::NonFastScrollableRegionOverlay::drawRect): Use SortedArrayMap and
+        some lambdas to make this code tighter and easier to read.
+
+        * page/PerformanceUserTiming.cpp:
+        (WebCore::restrictedMarkNamesToNavigationTimingFunctionMap): Deleted. Use
+        a SortedArrayMap instead, which should be similar in performance and uses no heap
+        or read/write memory.
+        (WebCore::restrictedMarkFunction): Deleted.
+        (WebCore::isRestrictedMarkNameNonMainThread): Deleted. This is now safe to do on
+        any thread.
+        (WebCore::PerformanceUserTiming::isRestrictedMarkName): Use the SortedArrayMap,
+        which has the benefit of relaxing the thread restrictions; this is now safe to
+        call on any thread.
+        (WebCore::PerformanceUserTiming::convertMarkToTimestamp const): Updated to use
+        the SortedArrayMap. There may be some additional simplification possible now
+        that the mark functions map can be used in any thread, but I wasn't sure.
+
+        * platform/cocoa/RemoteCommandListenerCocoa.mm:
+        (WebCore::mediaRemoteCommandForPlatformCommand): Use makeOptionalFromPointer.
+
+        * platform/graphics/FontCascade.cpp:
+        (WebCore::FontCascade::hasValidAverageCharWidth const): Use a SortedArraySet,
+        which should be similar in performance and uses no heap or read/write memory
+
+        * platform/graphics/FontPlatformData.cpp:
+        (WebCore::makeOptionalFromPointer): Deleted. Moved to SortedArrayMap.h.
+        * platform/graphics/HEVCUtilities.cpp:
+        (WebCore::makeOptionalFromPointer): Deleted. Moved to SortedArrayMap.h.
+
+        * platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm:
+        (WebCore::AVAssetMIMETypeCache::initializeCache): Updated for function name change.
+
+        * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
+        Tweaked use of UNUSED_PARAM a bit across the file, relying on omitted names instead.
+
+        * platform/graphics/cg/UTIRegistry.cpp:
+        (WebCore::defaultSupportedImageTypes): Use a constexpr array rather than HashSet,
+        on something just iterating this, not using it as a set.
+
+        * platform/graphics/cocoa/SourceBufferParserWebM.cpp:
+        (WebCore::SourceBufferParserWebM::supportedMIMETypes): Renamed from webmMIMETypes,
+        changed to return a Span so we don't have to allocate a HashSet, since callers
+        simply iterate this, and don't do set operations.
+        (WebCore::SourceBufferParserWebM::isSupportedVideoCodec): Replaced the
+        supportedVideoCodecs with this. We don't need a HashSet to check for two values,
+        and this should be faster and use less memory.
+        (WebCore::SourceBufferParserWebM::isSupportedAudioCodec): Ditto.
+        * platform/graphics/cocoa/SourceBufferParserWebM.h: Updated for the changes above.
+
+        * rendering/svg/SVGResources.cpp:
+        (WebCore::tagSet): Added this helper to make the code in the functions below less
+        repetitive.
+        (WebCore::clipperFilterMaskerTags): Use a constexpr array instead of many separate
+        calls to HashSet::add to construct the set.
+        (WebCore::markerTags): Ditto.
+        (WebCore::fillAndStrokeTags): Ditto.
+        (WebCore::chainableResourceTags): Ditto.
+
</ins><span class="cx"> 2021-12-18  Alex Christensen  <achristensen@webkit.org>
</span><span class="cx"> 
</span><span class="cx">         Use smart pointers for WebCoreNSURLSessionDataTask ObjC members
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediacapabilitiesMediaCapabilitiescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediacapabilities/MediaCapabilities.cpp (287231 => 287232)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediacapabilities/MediaCapabilities.cpp     2021-12-18 22:50:04 UTC (rev 287231)
+++ trunk/Source/WebCore/Modules/mediacapabilities/MediaCapabilities.cpp        2021-12-18 23:57:08 UTC (rev 287232)
</span><span class="lines">@@ -43,36 +43,33 @@
</span><span class="cx"> #include "Page.h"
</span><span class="cx"> #include "Settings.h"
</span><span class="cx"> #include <wtf/Logger.h>
</span><del>-#include <wtf/RobinHoodHashSet.h>
</del><ins>+#include <wtf/SortedArrayMap.h>
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-static const MemoryCompactLookupOnlyRobinHoodHashSet<String>& bucketMIMETypes()
</del><ins>+static bool isValidMediaMIMEType(const ContentType& contentType)
</ins><span class="cx"> {
</span><span class="cx">     // A "bucket" MIME types is one whose container type does not uniquely specify a codec.
</span><span class="cx">     // See: https://tools.ietf.org/html/rfc6381
</span><del>-    static NeverDestroyed<MemoryCompactLookupOnlyRobinHoodHashSet<String>> bucketMIMETypes(std::initializer_list<String> {
-        "audio/3gpp"_s,
-        "video/3gpp"_s,
-        "audio/3gpp2"_s,
-        "video/3gpp2"_s,
-        "audio/mp4"_s,
-        "video/mp4"_s,
-        "application/mp4"_s,
-        "video/quicktime"_s,
-        "application/mp21"_s,
-        "audio/vnd.apple.mpegurl"_s,
-        "video/vnd.apple.mpegurl"_s,
-        "audio/ogg"_s,
-        "video/ogg"_s,
-        "video/webm"_s,
-        "audio/webm"_s,
-    });
-    return bucketMIMETypes;
-}
</del><ins>+    static constexpr ComparableASCIILiteral bucketMIMETypeArray[] = {
+        "application/mp21",
+        "application/mp4",
+        "audio/3gpp",
+        "audio/3gpp2",
+        "audio/mp4",
+        "audio/ogg",
+        "audio/vnd.apple.mpegurl",
+        "audio/webm",
+        "video/3gpp",
+        "video/3gpp2",
+        "video/mp4",
+        "video/ogg",
+        "video/quicktime",
+        "video/vnd.apple.mpegurl",
+        "video/webm",
+    };
+    static constexpr SortedArraySet bucketMIMETypes { bucketMIMETypeArray };
</ins><span class="cx"> 
</span><del>-static bool isValidMediaMIMEType(const ContentType& contentType)
-{
</del><span class="cx">     // 2.1.4. MIME types
</span><span class="cx">     // https://wicg.github.io/media-capabilities/#valid-media-mime-type
</span><span class="cx">     // A valid media MIME type is a string that is a valid MIME type per [mimesniff]. If the MIME type does
</span><span class="lines">@@ -84,7 +81,7 @@
</span><span class="cx">     auto codecs = contentType.codecs();
</span><span class="cx"> 
</span><span class="cx">     // FIXME: The spec requires that the "codecs" parameter is the only parameter present.
</span><del>-    if (bucketMIMETypes().contains(contentType.containerType()))
</del><ins>+    if (bucketMIMETypes.contains(contentType.containerType()))
</ins><span class="cx">         return codecs.size() == 1;
</span><span class="cx">     return !codecs.size();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.cpp (287231 => 287232)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityObject.cpp       2021-12-18 22:50:04 UTC (rev 287231)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.cpp  2021-12-18 23:57:08 UTC (rev 287232)
</span><span class="lines">@@ -87,7 +87,6 @@
</span><span class="cx"> #include "VisibleUnits.h"
</span><span class="cx"> #include <pal/SessionID.h>
</span><span class="cx"> #include <wtf/NeverDestroyed.h>
</span><del>-#include <wtf/RobinHoodHashSet.h>
</del><span class="cx"> #include <wtf/StdLibExtras.h>
</span><span class="cx"> #include <wtf/text/StringBuilder.h>
</span><span class="cx"> #include <wtf/text/StringView.h>
</span><span class="lines">@@ -2842,29 +2841,28 @@
</span><span class="cx"> 
</span><span class="cx"> String AccessibilityObject::popupValue() const
</span><span class="cx"> {
</span><del>-    static const NeverDestroyed<MemoryCompactLookupOnlyRobinHoodHashSet<String>> allowedPopupValues(std::initializer_list<String> {
-        "menu"_s, "listbox"_s, "tree"_s, "grid"_s, "dialog"_s,
-    });
-
-    auto hasPopup = getAttribute(aria_haspopupAttr).convertToASCIILowercase();
-    if (hasPopup.isNull() || hasPopup.isEmpty()) {
</del><ins>+    auto& hasPopup = getAttribute(aria_haspopupAttr);
+    if (hasPopup.isEmpty()) {
</ins><span class="cx">         // In ARIA 1.1, the implicit value for combobox became "listbox."
</span><span class="cx">         if (isComboBox() || hasDatalist())
</span><del>-            return "listbox";
-        return "false";
</del><ins>+            return "listbox"_s;
+        return "false"_s;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (allowedPopupValues->contains(hasPopup))
-        return hasPopup;
</del><ins>+    for (auto& value : { "menu"_s, "listbox"_s, "tree"_s, "grid"_s, "dialog"_s }) {
+        // FIXME: Should fix ambiguity so we don't have to write "characters", but also don't create/destroy a String when passing an ASCIILiteral to equalIgnoringASCIICase.
+        if (equalIgnoringASCIICase(hasPopup, value.characters()))
+            return value;
+    }
</ins><span class="cx"> 
</span><span class="cx">     // aria-haspopup specification states that true must be treated as menu.
</span><del>-    if (hasPopup == "true")
-        return "menu";
</del><ins>+    if (equalLettersIgnoringASCIICase(hasPopup, "true"))
+        return "menu"_s;
</ins><span class="cx"> 
</span><span class="cx">     // The spec states that "User agents must treat any value of aria-haspopup that is not
</span><span class="cx">     // included in the list of allowed values, including an empty string, as if the value
</span><span class="cx">     // false had been provided."
</span><del>-    return "false";
</del><ins>+    return "false"_s;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool AccessibilityObject::hasDatalist() const
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityRenderObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (287231 => 287232)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp 2021-12-18 22:50:04 UTC (rev 287231)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp    2021-12-18 23:57:08 UTC (rev 287232)
</span><span class="lines">@@ -3214,7 +3214,7 @@
</span><span class="cx">     // those child elements are also presentational. For example, <li> becomes presentational from <ul>.
</span><span class="cx">     // http://www.w3.org/WAI/PF/aria/complete#presentation
</span><span class="cx"> 
</span><del>-    Span<LazyNeverDestroyed<const HTMLQualifiedName>* const> parentTags;
</del><ins>+    Span<decltype(aTag)* const> parentTags;
</ins><span class="cx">     switch (roleValue()) {
</span><span class="cx">     case AccessibilityRole::ListItem:
</span><span class="cx">     case AccessibilityRole::ListMarker: {
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (287231 => 287232)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2021-12-18 22:50:04 UTC (rev 287231)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm    2021-12-18 23:57:08 UTC (rev 287232)
</span><span class="lines">@@ -5210,18 +5210,18 @@
</span><span class="cx">     AddToImplIncludes("HTMLNames.h");
</span><span class="cx">     push(@$outputArray, "void ${className}::${functionName}(const Function<void(const AtomString& attributeName, const AtomString& eventName)>& function)\n");
</span><span class="cx">     push(@$outputArray, "{\n");
</span><del>-    push(@$outputArray, "    static constexpr std::pair<LazyNeverDestroyed<const QualifiedName>*, const AtomString EventNames::*> table[] = {\n");
</del><ins>+    push(@$outputArray, "    static constexpr std::pair<decltype(HTMLNames::altAttr)&, const AtomString EventNames::*> table[] = {\n");
</ins><span class="cx">     foreach my $attribute (@{$interface->attributes}) {
</span><span class="cx">         if ($attribute->type->name eq "EventHandler" && (!defined $eventHandlerExtendedAttributeName || $attribute->extendedAttributes->{$eventHandlerExtendedAttributeName})) {
</span><span class="cx">             my $attributeName = $attribute->name;
</span><span class="cx">             my $eventName = EventHandlerAttributeShortEventName($attribute);
</span><del>-            push(@$outputArray, "        { &HTMLNames::${attributeName}Attr, &EventNames::${eventName} },\n");
</del><ins>+            push(@$outputArray, "        { HTMLNames::${attributeName}Attr, &EventNames::${eventName} },\n");
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx">     push(@$outputArray, "    };\n");
</span><span class="cx">     push(@$outputArray, "    auto& eventNames = WebCore::eventNames();\n");
</span><span class="cx">     push(@$outputArray, "    for (auto& names : table)\n");
</span><del>-    push(@$outputArray, "        function(names.first->get().localName(), eventNames.*names.second);\n");
</del><ins>+    push(@$outputArray, "        function(names.first.get().localName(), eventNames.*names.second);\n");
</ins><span class="cx">     push(@$outputArray, "}\n\n");
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Element.cpp (287231 => 287232)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Element.cpp     2021-12-18 22:50:04 UTC (rev 287231)
+++ trunk/Source/WebCore/dom/Element.cpp        2021-12-18 23:57:08 UTC (rev 287232)
</span><span class="lines">@@ -2485,31 +2485,31 @@
</span><span class="cx"> 
</span><span class="cx"> static bool canAttachAuthorShadowRoot(const Element& element)
</span><span class="cx"> {
</span><del>-    static NeverDestroyed<MemoryCompactLookupOnlyRobinHoodHashSet<AtomString>> tagNames = [] {
-        static const HTMLQualifiedName* const tagList[] = {
-            &articleTag.get(),
-            &asideTag.get(),
-            &blockquoteTag.get(),
-            &bodyTag.get(),
-            &divTag.get(),
-            &footerTag.get(),
-            &h1Tag.get(),
-            &h2Tag.get(),
-            &h3Tag.get(),
-            &h4Tag.get(),
-            &h5Tag.get(),
-            &h6Tag.get(),
-            &headerTag.get(),
-            &mainTag.get(),
-            &navTag.get(),
-            &pTag.get(),
-            &sectionTag.get(),
-            &spanTag.get()
</del><ins>+    static NeverDestroyed tagNames = [] {
+        static constexpr std::array tagList {
+            &articleTag,
+            &asideTag,
+            &blockquoteTag,
+            &bodyTag,
+            &divTag,
+            &footerTag,
+            &h1Tag,
+            &h2Tag,
+            &h3Tag,
+            &h4Tag,
+            &h5Tag,
+            &h6Tag,
+            &headerTag,
+            &mainTag,
+            &navTag,
+            &pTag,
+            &sectionTag,
+            &spanTag
</ins><span class="cx">         };
</span><span class="cx">         MemoryCompactLookupOnlyRobinHoodHashSet<AtomString> set;
</span><span class="cx">         set.reserveInitialCapacity(sizeof(tagList));
</span><span class="cx">         for (auto& name : tagList)
</span><del>-            set.add(name->localName());
</del><ins>+            set.add(name->get().localName());
</ins><span class="cx">         return set;
</span><span class="cx">     }();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoredommake_namespl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/make_names.pl (287231 => 287232)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/make_names.pl   2021-12-18 22:50:04 UTC (rev 287231)
+++ trunk/Source/WebCore/dom/make_names.pl      2021-12-18 23:57:08 UTC (rev 287232)
</span><span class="lines">@@ -994,31 +994,27 @@
</span><span class="cx"> 
</span><span class="cx">     printConstructors($F, \%tagConstructorMap);
</span><span class="cx"> 
</span><ins>+    my $firstTag;
+    for my $tag (sort keys %tagConstructorMap) {
+        $firstTag = $tag;
+        last;
+    }
+
</ins><span class="cx">     print F <<END
</span><span class="cx"> 
</span><span class="cx"> struct $parameters{namespace}ConstructorFunctionMapEntry {
</span><del>-    $parameters{namespace}ConstructorFunctionMapEntry($parameters{namespace}ConstructorFunction function, const QualifiedName& name)
-        : function(function)
-        , qualifiedName(&name)
-    { }
-
-    $parameters{namespace}ConstructorFunctionMapEntry()
-        : function(nullptr)
-        , qualifiedName(nullptr)
-    { }
-
-    $parameters{namespace}ConstructorFunction function;
-    const QualifiedName* qualifiedName; // Use pointer instead of reference so that emptyValue() in HashMap is cheap to create.
</del><ins>+    $parameters{namespace}ConstructorFunction function { nullptr };
+    const QualifiedName* qualifiedName { nullptr }; // Use pointer instead of reference so that emptyValue() in HashMap is cheap to create.
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> static NEVER_INLINE MemoryCompactLookupOnlyRobinHoodHashMap<AtomString, $parameters{namespace}ConstructorFunctionMapEntry> create$parameters{namespace}FactoryMap()
</span><span class="cx"> {
</span><span class="cx">     struct TableEntry {
</span><del>-        const QualifiedName& name;
</del><ins>+        decltype($parameters{namespace}Names::${firstTag}Tag)& name;
</ins><span class="cx">         $parameters{namespace}ConstructorFunction function;
</span><span class="cx">     };
</span><span class="cx"> 
</span><del>-    static const TableEntry table[] = {
</del><ins>+    static constexpr TableEntry table[] = {
</ins><span class="cx"> END
</span><span class="cx">     ;
</span><span class="cx"> 
</span><span class="lines">@@ -1029,7 +1025,7 @@
</span><span class="cx"> 
</span><span class="cx">     MemoryCompactLookupOnlyRobinHoodHashMap<AtomString, $parameters{namespace}ConstructorFunctionMapEntry> map;
</span><span class="cx">     for (auto& entry : table)
</span><del>-        map.add(entry.name.localName(), $parameters{namespace}ConstructorFunctionMapEntry(entry.function, entry.name));
</del><ins>+        map.add(entry.name.get().localName(), $parameters{namespace}ConstructorFunctionMapEntry { entry.function, &entry.name.get() });
</ins><span class="cx">     return map;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1261,16 +1257,22 @@
</span><span class="cx"> 
</span><span class="cx">     printWrapperFunctions($F);
</span><span class="cx"> 
</span><ins>+    my $firstTag;
+    for my $tag (sort keys %allTags) {
+        $firstTag = $tag;
+        last;
+    }
+
</ins><span class="cx"> print F <<END
</span><span class="cx"> 
</span><span class="cx"> static NEVER_INLINE MemoryCompactLookupOnlyRobinHoodHashMap<AtomString, Create$parameters{namespace}ElementWrapperFunction> create$parameters{namespace}WrapperMap()
</span><span class="cx"> {
</span><span class="cx">     struct TableEntry {
</span><del>-        const QualifiedName& name;
</del><ins>+        decltype($parameters{namespace}Names::${firstTag}Tag)& name;
</ins><span class="cx">         Create$parameters{namespace}ElementWrapperFunction function;
</span><span class="cx">     };
</span><span class="cx"> 
</span><del>-    static const TableEntry table[] = {
</del><ins>+    static constexpr TableEntry table[] = {
</ins><span class="cx"> END
</span><span class="cx"> ;
</span><span class="cx"> 
</span><span class="lines">@@ -1303,7 +1305,7 @@
</span><span class="cx"> 
</span><span class="cx">     MemoryCompactLookupOnlyRobinHoodHashMap<AtomString, Create$parameters{namespace}ElementWrapperFunction> map;
</span><span class="cx">     for (auto& entry : table)
</span><del>-        map.add(entry.name.localName(), entry.function);
</del><ins>+        map.add(entry.name.get().localName(), entry.function);
</ins><span class="cx">     return map;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingReplaceSelectionCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp (287231 => 287232)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp 2021-12-18 22:50:04 UTC (rev 287231)
+++ trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp    2021-12-18 23:57:08 UTC (rev 287232)
</span><span class="lines">@@ -778,6 +778,7 @@
</span><span class="cx">             &xmpTag,
</span><span class="cx">         };
</span><span class="cx">         MemoryCompactLookupOnlyRobinHoodHashSet<AtomString> set;
</span><ins>+        set.reserveInitialCapacity(std::size(tags));
</ins><span class="cx">         for (auto& tag : tags)
</span><span class="cx">             set.add(tag->get().localName());
</span><span class="cx">         return set;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlAutofillcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/Autofill.cpp (287231 => 287232)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/Autofill.cpp   2021-12-18 22:50:04 UTC (rev 287231)
+++ trunk/Source/WebCore/html/Autofill.cpp      2021-12-18 23:57:08 UTC (rev 287232)
</span><span class="lines">@@ -30,106 +30,79 @@
</span><span class="cx"> #include "HTMLFormControlElement.h"
</span><span class="cx"> #include "HTMLFormElement.h"
</span><span class="cx"> #include "HTMLNames.h"
</span><del>-#include <wtf/HashMap.h>
-#include <wtf/NeverDestroyed.h>
-#include <wtf/RobinHoodHashMap.h>
-#include <wtf/text/AtomString.h>
-#include <wtf/text/AtomStringHash.h>
</del><ins>+#include <wtf/SortedArrayMap.h>
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-enum class AutofillCategory {
-    Off,
-    Automatic,
-    Normal,
-    Contact,
-};
</del><ins>+enum class AutofillCategory : uint8_t { Off, Automatic, Normal, Contact };
</ins><span class="cx"> 
</span><del>-struct AutofillInfo {
-    AutofillFieldName fieldName;
</del><ins>+struct AutofillFieldNameMapping {
+    AutofillFieldName name;
</ins><span class="cx">     AutofillCategory category;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-static const MemoryCompactLookupOnlyRobinHoodHashMap<AtomString, AutofillInfo>& fieldNameMap()
-{
-    static NeverDestroyed map = [] {
-        struct MapEntry {
-            ASCIILiteral name;
-            AutofillInfo value;
-        };
-        static constexpr MapEntry entries[] = {
-            { "off"_s, { AutofillFieldName::None, AutofillCategory::Off } },
-            { "on"_s, { AutofillFieldName::None, AutofillCategory::Automatic } },
-            { "name"_s, { AutofillFieldName::Name, AutofillCategory::Normal } },
-            { "honorific-prefix"_s, { AutofillFieldName::HonorificPrefix, AutofillCategory::Normal } },
-            { "given-name"_s, { AutofillFieldName::GivenName, AutofillCategory::Normal } },
-            { "additional-name"_s, { AutofillFieldName::AdditionalName, AutofillCategory::Normal } },
-            { "family-name"_s, { AutofillFieldName::FamilyName, AutofillCategory::Normal } },
-            { "honorific-suffix"_s, { AutofillFieldName::HonorificSuffix, AutofillCategory::Normal } },
-            { "nickname"_s, { AutofillFieldName::Nickname, AutofillCategory::Normal } },
-            { "username"_s, { AutofillFieldName::Username, AutofillCategory::Normal } },
-            { "new-password"_s, { AutofillFieldName::NewPassword, AutofillCategory::Normal } },
-            { "current-password"_s, { AutofillFieldName::CurrentPassword, AutofillCategory::Normal } },
-            { "organization-title"_s, { AutofillFieldName::OrganizationTitle, AutofillCategory::Normal } },
-            { "organization"_s, { AutofillFieldName::Organization, AutofillCategory::Normal } },
-            { "street-address"_s, { AutofillFieldName::StreetAddress, AutofillCategory::Normal } },
-            { "address-line1"_s, { AutofillFieldName::AddressLine1, AutofillCategory::Normal } },
-            { "address-line2"_s, { AutofillFieldName::AddressLine2, AutofillCategory::Normal } },
-            { "address-line3"_s, { AutofillFieldName::AddressLine3, AutofillCategory::Normal } },
-            { "address-level4"_s, { AutofillFieldName::AddressLevel4, AutofillCategory::Normal } },
-            { "address-level3"_s, { AutofillFieldName::AddressLevel3, AutofillCategory::Normal } },
-            { "address-level2"_s, { AutofillFieldName::AddressLevel2, AutofillCategory::Normal } },
-            { "address-level1"_s, { AutofillFieldName::AddressLevel1, AutofillCategory::Normal } },
-            { "country"_s, { AutofillFieldName::Country, AutofillCategory::Normal } },
-            { "country-name"_s, { AutofillFieldName::CountryName, AutofillCategory::Normal } },
-            { "postal-code"_s, { AutofillFieldName::PostalCode, AutofillCategory::Normal } },
-            { "cc-name"_s, { AutofillFieldName::CcName, AutofillCategory::Normal } },
-            { "cc-given-name"_s, { AutofillFieldName::CcGivenName, AutofillCategory::Normal } },
-            { "cc-additional-name"_s, { AutofillFieldName::CcAdditionalName, AutofillCategory::Normal } },
-            { "cc-family-name"_s, { AutofillFieldName::CcFamilyName, AutofillCategory::Normal } },
-            { "cc-number"_s, { AutofillFieldName::CcNumber, AutofillCategory::Normal } },
-            { "cc-exp"_s, { AutofillFieldName::CcExp, AutofillCategory::Normal } },
-            { "cc-exp-month"_s, { AutofillFieldName::CcExpMonth, AutofillCategory::Normal } },
-            { "cc-exp-year"_s, { AutofillFieldName::CcExpYear, AutofillCategory::Normal } },
-            { "cc-csc"_s, { AutofillFieldName::CcCsc, AutofillCategory::Normal } },
-            { "cc-type"_s, { AutofillFieldName::CcType, AutofillCategory::Normal } },
-            { "transaction-currency"_s, { AutofillFieldName::TransactionCurrency, AutofillCategory::Normal } },
-            { "transaction-amount"_s, { AutofillFieldName::TransactionAmount, AutofillCategory::Normal } },
-            { "language"_s, { AutofillFieldName::Language, AutofillCategory::Normal } },
-            { "bday"_s, { AutofillFieldName::Bday, AutofillCategory::Normal } },
-            { "bday-day"_s, { AutofillFieldName::BdayDay, AutofillCategory::Normal } },
-            { "bday-month"_s, { AutofillFieldName::BdayMonth, AutofillCategory::Normal } },
-            { "bday-year"_s, { AutofillFieldName::BdayYear, AutofillCategory::Normal } },
-            { "sex"_s, { AutofillFieldName::Sex, AutofillCategory::Normal } },
-            { "url"_s, { AutofillFieldName::URL, AutofillCategory::Normal } },
-            { "photo"_s, { AutofillFieldName::Photo, AutofillCategory::Normal } },
</del><ins>+static constexpr std::pair<ComparableLettersLiteral, AutofillFieldNameMapping> fieldNameMappings[] = {
+    { "additional-name", { AutofillFieldName::AdditionalName, AutofillCategory::Normal } },
+    { "address-level1", { AutofillFieldName::AddressLevel1, AutofillCategory::Normal } },
+    { "address-level2", { AutofillFieldName::AddressLevel2, AutofillCategory::Normal } },
+    { "address-level3", { AutofillFieldName::AddressLevel3, AutofillCategory::Normal } },
+    { "address-level4", { AutofillFieldName::AddressLevel4, AutofillCategory::Normal } },
+    { "address-line1", { AutofillFieldName::AddressLine1, AutofillCategory::Normal } },
+    { "address-line2", { AutofillFieldName::AddressLine2, AutofillCategory::Normal } },
+    { "address-line3", { AutofillFieldName::AddressLine3, AutofillCategory::Normal } },
+    { "bday", { AutofillFieldName::Bday, AutofillCategory::Normal } },
+    { "bday-day", { AutofillFieldName::BdayDay, AutofillCategory::Normal } },
+    { "bday-month", { AutofillFieldName::BdayMonth, AutofillCategory::Normal } },
+    { "bday-year", { AutofillFieldName::BdayYear, AutofillCategory::Normal } },
+    { "cc-additional-name", { AutofillFieldName::CcAdditionalName, AutofillCategory::Normal } },
+    { "cc-csc", { AutofillFieldName::CcCsc, AutofillCategory::Normal } },
+    { "cc-exp", { AutofillFieldName::CcExp, AutofillCategory::Normal } },
+    { "cc-exp-month", { AutofillFieldName::CcExpMonth, AutofillCategory::Normal } },
+    { "cc-exp-year", { AutofillFieldName::CcExpYear, AutofillCategory::Normal } },
+    { "cc-family-name", { AutofillFieldName::CcFamilyName, AutofillCategory::Normal } },
+    { "cc-given-name", { AutofillFieldName::CcGivenName, AutofillCategory::Normal } },
+    { "cc-name", { AutofillFieldName::CcName, AutofillCategory::Normal } },
+    { "cc-number", { AutofillFieldName::CcNumber, AutofillCategory::Normal } },
+    { "cc-type", { AutofillFieldName::CcType, AutofillCategory::Normal } },
+    { "country", { AutofillFieldName::Country, AutofillCategory::Normal } },
+    { "country-name", { AutofillFieldName::CountryName, AutofillCategory::Normal } },
+    { "current-password", { AutofillFieldName::CurrentPassword, AutofillCategory::Normal } },
+    { "email", { AutofillFieldName::Email, AutofillCategory::Contact } },
+    { "family-name", { AutofillFieldName::FamilyName, AutofillCategory::Normal } },
+    { "given-name", { AutofillFieldName::GivenName, AutofillCategory::Normal } },
+    { "honorific-prefix", { AutofillFieldName::HonorificPrefix, AutofillCategory::Normal } },
+    { "honorific-suffix", { AutofillFieldName::HonorificSuffix, AutofillCategory::Normal } },
+    { "impp", { AutofillFieldName::Impp, AutofillCategory::Contact } },
+    { "language", { AutofillFieldName::Language, AutofillCategory::Normal } },
+    { "name", { AutofillFieldName::Name, AutofillCategory::Normal } },
+    { "new-password", { AutofillFieldName::NewPassword, AutofillCategory::Normal } },
+    { "nickname", { AutofillFieldName::Nickname, AutofillCategory::Normal } },
+    { "off", { AutofillFieldName::None, AutofillCategory::Off } },
+    { "on", { AutofillFieldName::None, AutofillCategory::Automatic } },
+    { "organization", { AutofillFieldName::Organization, AutofillCategory::Normal } },
+    { "organization-title", { AutofillFieldName::OrganizationTitle, AutofillCategory::Normal } },
+    { "photo", { AutofillFieldName::Photo, AutofillCategory::Normal } },
+    { "postal-code", { AutofillFieldName::PostalCode, AutofillCategory::Normal } },
+    { "sex", { AutofillFieldName::Sex, AutofillCategory::Normal } },
+    { "street-address", { AutofillFieldName::StreetAddress, AutofillCategory::Normal } },
+    { "tel", { AutofillFieldName::Tel, AutofillCategory::Contact } },
+    { "tel-area-code", { AutofillFieldName::TelAreaCode, AutofillCategory::Contact } },
+    { "tel-country-code", { AutofillFieldName::TelCountryCode, AutofillCategory::Contact } },
+    { "tel-extension", { AutofillFieldName::TelExtension, AutofillCategory::Contact } },
+    { "tel-local", { AutofillFieldName::TelLocal, AutofillCategory::Contact } },
+    { "tel-local-prefix", { AutofillFieldName::TelLocalPrefix, AutofillCategory::Contact } },
+    { "tel-local-suffix", { AutofillFieldName::TelLocalSuffix, AutofillCategory::Contact } },
+    { "tel-national", { AutofillFieldName::TelNational, AutofillCategory::Contact } },
+    { "transaction-amount", { AutofillFieldName::TransactionAmount, AutofillCategory::Normal } },
+    { "transaction-currency", { AutofillFieldName::TransactionCurrency, AutofillCategory::Normal } },
+    { "url", { AutofillFieldName::URL, AutofillCategory::Normal } },
+    { "username", { AutofillFieldName::Username, AutofillCategory::Normal } },
+};
+static constexpr SortedArrayMap fieldNameMap { fieldNameMappings };
</ins><span class="cx"> 
</span><del>-            { "tel"_s, { AutofillFieldName::Tel, AutofillCategory::Contact } },
-            { "tel-country-code"_s, { AutofillFieldName::TelCountryCode, AutofillCategory::Contact } },
-            { "tel-national"_s, { AutofillFieldName::TelNational, AutofillCategory::Contact } },
-            { "tel-area-code"_s, { AutofillFieldName::TelAreaCode, AutofillCategory::Contact } },
-            { "tel-local"_s, { AutofillFieldName::TelLocal, AutofillCategory::Contact } },
-            { "tel-local-prefix"_s, { AutofillFieldName::TelLocalPrefix, AutofillCategory::Contact } },
-            { "tel-local-suffix"_s, { AutofillFieldName::TelLocalSuffix, AutofillCategory::Contact } },
-            { "tel-extension"_s, { AutofillFieldName::TelExtension, AutofillCategory::Contact } },
-            { "email"_s, { AutofillFieldName::Email, AutofillCategory::Contact } },
-            { "impp"_s, { AutofillFieldName::Impp, AutofillCategory::Contact } },
-        };
-        MemoryCompactLookupOnlyRobinHoodHashMap<AtomString, AutofillInfo> map;
-        for (auto& entry : entries)
-            map.add(entry.name, entry.value);
-        return map;
-    }();
-    return map;
-}
-
</del><span class="cx"> AutofillFieldName toAutofillFieldName(const AtomString& value)
</span><span class="cx"> {
</span><del>-    auto map = fieldNameMap();
-    auto it = map.find(value);
-    if (it == map.end())
-        return AutofillFieldName::None;
-    return it->value.fieldName;
</del><ins>+    return fieldNameMap.get(value).name;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static inline bool isContactToken(const AtomString& token)
</span><span class="lines">@@ -204,13 +177,12 @@
</span><span class="cx">     // token's row, then jump to the step labeled default. Otherwise, let field be the string given
</span><span class="cx">     // in the cell of the first column of the matching row, and let category be the value of the
</span><span class="cx">     // cell in the third column of that same row.
</span><del>-    auto& map = fieldNameMap();
</del><span class="cx"> 
</span><del>-    auto it = map.find(tokens[index]);
-    if (it == map.end())
</del><ins>+    auto mapEntry = fieldNameMap.tryGet(tokens[index]);
+    if (!mapEntry)
</ins><span class="cx">         return defaultLabel();
</span><span class="cx">     
</span><del>-    auto category = it->value.category;
</del><ins>+    auto category = mapEntry->category;
</ins><span class="cx"> 
</span><span class="cx">     if (tokens.size() > maxTokensForAutofillFieldCategory(category))
</span><span class="cx">         return defaultLabel();
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLDocument.cpp (287231 => 287232)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLDocument.cpp       2021-12-18 22:50:04 UTC (rev 287231)
+++ trunk/Source/WebCore/html/HTMLDocument.cpp  2021-12-18 23:57:08 UTC (rev 287232)
</span><span class="lines">@@ -227,6 +227,7 @@
</span><span class="cx">             &vlinkAttr,
</span><span class="cx">         };
</span><span class="cx">         MemoryCompactLookupOnlyRobinHoodHashSet<AtomString> set;
</span><ins>+        set.reserveInitialCapacity(std::size(names));
</ins><span class="cx">         for (auto* name : names)
</span><span class="cx">             set.add(name->get().localName());
</span><span class="cx">         return set;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLObjectElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLObjectElement.cpp (287231 => 287232)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLObjectElement.cpp  2021-12-18 22:50:04 UTC (rev 287231)
+++ trunk/Source/WebCore/html/HTMLObjectElement.cpp     2021-12-18 23:57:08 UTC (rev 287232)
</span><span class="lines">@@ -359,6 +359,7 @@
</span><span class="cx">     static NeverDestroyed mostKnownTags = [] {
</span><span class="cx">         MemoryCompactLookupOnlyRobinHoodHashSet<QualifiedName> set;
</span><span class="cx">         auto* tags = HTMLNames::getHTMLTags();
</span><ins>+        set.reserveInitialCapacity(HTMLNames::HTMLTagsCount);
</ins><span class="cx">         for (size_t i = 0; i < HTMLNames::HTMLTagsCount; i++) {
</span><span class="cx">             auto& tag = *tags[i];
</span><span class="cx">             // Only the param element was explicitly mentioned in the HTML specification rule
</span></span></pre></div>
<a id="trunkSourceWebCorepageDebugPageOverlayscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DebugPageOverlays.cpp (287231 => 287232)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DebugPageOverlays.cpp  2021-12-18 22:50:04 UTC (rev 287231)
+++ trunk/Source/WebCore/page/DebugPageOverlays.cpp     2021-12-18 23:57:08 UTC (rev 287232)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2014-2017 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2014-2021 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -36,7 +36,7 @@
</span><span class="cx"> #include "Region.h"
</span><span class="cx"> #include "ScrollingCoordinator.h"
</span><span class="cx"> #include "Settings.h"
</span><del>-#include <wtf/RobinHoodHashMap.h>
</del><ins>+#include <wtf/SortedArrayMap.h>
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -150,21 +150,6 @@
</span><span class="cx">     return regionChanged;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static const MemoryCompactLookupOnlyRobinHoodHashMap<String, SRGBA<uint8_t>>& touchEventRegionColors()
-{
-    static NeverDestroyed regionColors { MemoryCompactLookupOnlyRobinHoodHashMap<String, SRGBA<uint8_t>> { {
-        { "touchstart"_s, { 191, 191, 63, 50 } },
-        { "touchmove"_s, { 80, 204, 245, 50 } },
-        { "touchend"_s, { 191, 63, 127, 50 } },
-        { "touchforcechange"_s, { 63, 63, 191, 50 } },
-        { "wheel"_s, { 255, 128, 0, 50 } },
-        { "mousedown"_s, { 80, 245, 80, 50 } },
-        { "mousemove"_s, { 245, 245, 80, 50 } },
-        { "mouseup"_s, { 80, 245, 176, 50 } },
-    } } };
-    return regionColors;
-}
-
</del><span class="cx"> static void drawRightAlignedText(const String& text, GraphicsContext& context, const FontCascade& font, const FloatPoint& boxLocation)
</span><span class="cx"> {
</span><span class="cx">     float textGap = 10;
</span><span class="lines">@@ -178,6 +163,19 @@
</span><span class="cx"> 
</span><span class="cx"> void NonFastScrollableRegionOverlay::drawRect(PageOverlay& pageOverlay, GraphicsContext& context, const IntRect&)
</span><span class="cx"> {
</span><ins>+    static constexpr std::pair<ComparableASCIILiteral, SRGBA<uint8_t>> colorMappings[] = {
+        { "mousedown", { 80, 245, 80, 50 } },
+        { "mousemove", { 245, 245, 80, 50 } },
+        { "mouseup", { 80, 245, 176, 50 } },
+        { "touchend", { 191, 63, 127, 50 } },
+        { "touchforcechange", { 63, 63, 191, 50 } },
+        { "touchmove", { 80, 204, 245, 50 } },
+        { "touchstart", { 191, 191, 63, 50 } },
+        { "wheel", { 255, 128, 0, 50 } },
+    };
+    constexpr SortedArrayMap colors { colorMappings };
+    constexpr auto defaultColor = Color::black.colorWithAlphaByte(64);
+
</ins><span class="cx">     IntRect bounds = pageOverlay.bounds();
</span><span class="cx">     
</span><span class="cx">     context.clearRect(bounds);
</span><span class="lines">@@ -192,60 +190,32 @@
</span><span class="cx">     FontCascade font(WTFMove(fontDescription), 0, 0);
</span><span class="cx">     font.update(nullptr);
</span><span class="cx"> 
</span><ins>+    auto drawLegend = [&] (const Color& color, ASCIILiteral text) {
+        context.setFillColor(color);
+        context.fillRect(legendRect);
+        drawRightAlignedText(text, context, font, legendRect.location());
+        legendRect.move(0, 30);
+    };
+
</ins><span class="cx"> #if ENABLE(TOUCH_EVENTS)
</span><del>-    context.setFillColor(touchEventRegionColors().get("touchstart"_s));
-    context.fillRect(legendRect);
-    drawRightAlignedText("touchstart"_s, context, font, legendRect.location());
-
-    legendRect.move(0, 30);
-    context.setFillColor(touchEventRegionColors().get("touchmove"_s));
-    context.fillRect(legendRect);
-    drawRightAlignedText("touchmove"_s, context, font, legendRect.location());
-
-    legendRect.move(0, 30);
-    context.setFillColor(touchEventRegionColors().get("touchend"_s));
-    context.fillRect(legendRect);
-    drawRightAlignedText("touchend"_s, context, font, legendRect.location());
-
-    legendRect.move(0, 30);
-    context.setFillColor(touchEventRegionColors().get("touchforcechange"_s));
-    context.fillRect(legendRect);
-    drawRightAlignedText("touchforcechange"_s, context, font, legendRect.location());
-
-    legendRect.move(0, 30);
-    context.setFillColor(m_color);
-    context.fillRect(legendRect);
-    drawRightAlignedText("passive listeners"_s, context, font, legendRect.location());
-
-    legendRect.move(0, 30);
-    context.setFillColor(touchEventRegionColors().get("mousedown"_s));
-    context.fillRect(legendRect);
-    drawRightAlignedText("mousedown"_s, context, font, legendRect.location());
-
-    legendRect.move(0, 30);
-    context.setFillColor(touchEventRegionColors().get("mousemove"_s));
-    context.fillRect(legendRect);
-    drawRightAlignedText("mousemove"_s, context, font, legendRect.location());
-
-    legendRect.move(0, 30);
-    context.setFillColor(touchEventRegionColors().get("mouseup"_s));
-    context.fillRect(legendRect);
-    drawRightAlignedText("mouseup"_s, context, font, legendRect.location());
</del><ins>+    auto drawEventLegend = [&] (ASCIILiteral color) {
+        drawLegend(colors.get(StringView { color }), color);
+    };
+    drawEventLegend("touchstart"_s);
+    drawEventLegend("touchmove"_s);
+    drawEventLegend("touchend"_s);
+    drawEventLegend("touchforcechange"_s);
+    drawLegend(m_color, "passive listeners"_s);
+    drawEventLegend("mousedown"_s);
+    drawEventLegend("mousemove"_s);
+    drawEventLegend("mouseup"_s);
</ins><span class="cx"> #else
</span><span class="cx">     // On desktop platforms, the "wheel" region includes the non-fast scrollable region.
</span><del>-    context.setFillColor(touchEventRegionColors().get("wheel"_s));
-    context.fillRect(legendRect);
-    drawRightAlignedText("non-fast region"_s, context, font, legendRect.location());
</del><ins>+    drawLegend(colors.get("wheel"), "non-fast region"_s);
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    for (const auto& synchronousEventRegion : m_eventTrackingRegions.eventSpecificSynchronousDispatchRegions) {
-        auto regionColor = Color::black.colorWithAlphaByte(64);
-        auto it = touchEventRegionColors().find(synchronousEventRegion.key);
-        if (it != touchEventRegionColors().end())
-            regionColor = it->value;
-        drawRegion(context, synchronousEventRegion.value, regionColor, bounds);
-    }
-
</del><ins>+    for (auto& region : m_eventTrackingRegions.eventSpecificSynchronousDispatchRegions)
+        drawRegion(context, region.value, colors.get(region.key, defaultColor), bounds);
</ins><span class="cx">     drawRegion(context, m_eventTrackingRegions.asynchronousDispatchRegion, m_color, bounds);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepagePerformanceUserTimingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/PerformanceUserTiming.cpp (287231 => 287232)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PerformanceUserTiming.cpp      2021-12-18 22:50:04 UTC (rev 287231)
+++ trunk/Source/WebCore/page/PerformanceUserTiming.cpp 2021-12-18 23:57:08 UTC (rev 287232)
</span><span class="lines">@@ -34,62 +34,40 @@
</span><span class="cx"> #include "PerformanceTiming.h"
</span><span class="cx"> #include "SerializedScriptValue.h"
</span><span class="cx"> #include <JavaScriptCore/JSCJSValueInlines.h>
</span><del>-#include <wtf/NeverDestroyed.h>
-#include <wtf/RobinHoodHashMap.h>
</del><ins>+#include <wtf/SortedArrayMap.h>
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> using NavigationTimingFunction = unsigned long long (PerformanceTiming::*)() const;
</span><del>-static const MemoryCompactLookupOnlyRobinHoodHashMap<String, NavigationTimingFunction>& restrictedMarkNamesToNavigationTimingFunctionMap()
-{
-    ASSERT(isMainThread());
-    static NeverDestroyed map = MemoryCompactLookupOnlyRobinHoodHashMap<String, NavigationTimingFunction> {
-        { "connectEnd"_s, &PerformanceTiming::connectEnd },
-        { "connectStart"_s, &PerformanceTiming::connectStart },
-        { "domComplete"_s, &PerformanceTiming::domComplete },
-        { "domContentLoadedEventEnd"_s, &PerformanceTiming::domContentLoadedEventEnd },
-        { "domContentLoadedEventStart"_s, &PerformanceTiming::domContentLoadedEventStart },
-        { "domInteractive"_s, &PerformanceTiming::domInteractive },
-        { "domLoading"_s, &PerformanceTiming::domLoading },
-        { "domainLookupEnd"_s, &PerformanceTiming::domainLookupEnd },
-        { "domainLookupStart"_s, &PerformanceTiming::domainLookupStart },
-        { "fetchStart"_s, &PerformanceTiming::fetchStart },
-        { "loadEventEnd"_s, &PerformanceTiming::loadEventEnd },
-        { "loadEventStart"_s, &PerformanceTiming::loadEventStart },
-        { "navigationStart"_s, &PerformanceTiming::navigationStart },
-        { "redirectEnd"_s, &PerformanceTiming::redirectEnd },
-        { "redirectStart"_s, &PerformanceTiming::redirectStart },
-        { "requestStart"_s, &PerformanceTiming::requestStart },
-        { "responseEnd"_s, &PerformanceTiming::responseEnd },
-        { "responseStart"_s, &PerformanceTiming::responseStart },
-        { "secureConnectionStart"_s, &PerformanceTiming::secureConnectionStart },
-        { "unloadEventEnd"_s, &PerformanceTiming::unloadEventEnd },
-        { "unloadEventStart"_s, &PerformanceTiming::unloadEventStart },
-    };
-    return map;
-}
</del><span class="cx"> 
</span><del>-static NavigationTimingFunction restrictedMarkFunction(const String& markName)
-{
-    ASSERT(isMainThread());
-    return restrictedMarkNamesToNavigationTimingFunctionMap().get(markName);
-}
</del><ins>+static constexpr std::pair<ComparableASCIILiteral, NavigationTimingFunction> restrictedMarkMappings[] = {
+    { "connectEnd", &PerformanceTiming::connectEnd },
+    { "connectStart", &PerformanceTiming::connectStart },
+    { "domComplete", &PerformanceTiming::domComplete },
+    { "domContentLoadedEventEnd", &PerformanceTiming::domContentLoadedEventEnd },
+    { "domContentLoadedEventStart", &PerformanceTiming::domContentLoadedEventStart },
+    { "domInteractive", &PerformanceTiming::domInteractive },
+    { "domLoading", &PerformanceTiming::domLoading },
+    { "domainLookupEnd", &PerformanceTiming::domainLookupEnd },
+    { "domainLookupStart", &PerformanceTiming::domainLookupStart },
+    { "fetchStart", &PerformanceTiming::fetchStart },
+    { "loadEventEnd", &PerformanceTiming::loadEventEnd },
+    { "loadEventStart", &PerformanceTiming::loadEventStart },
+    { "navigationStart", &PerformanceTiming::navigationStart },
+    { "redirectEnd", &PerformanceTiming::redirectEnd },
+    { "redirectStart", &PerformanceTiming::redirectStart },
+    { "requestStart", &PerformanceTiming::requestStart },
+    { "responseEnd", &PerformanceTiming::responseEnd },
+    { "responseStart", &PerformanceTiming::responseStart },
+    { "secureConnectionStart", &PerformanceTiming::secureConnectionStart },
+    { "unloadEventEnd", &PerformanceTiming::unloadEventEnd },
+    { "unloadEventStart", &PerformanceTiming::unloadEventStart },
+};
+static constexpr SortedArrayMap restrictedMarkFunctions { restrictedMarkMappings };
</ins><span class="cx"> 
</span><del>-static bool isRestrictedMarkNameNonMainThread(const String& markName)
-{
-    ASSERT(!isMainThread());
-
-    bool isRestricted;
-    callOnMainThreadAndWait([&isRestricted, markName = markName.isolatedCopy()] {
-        isRestricted = restrictedMarkNamesToNavigationTimingFunctionMap().contains(markName);
-    });
-    return isRestricted;
-}
-
</del><span class="cx"> bool PerformanceUserTiming::isRestrictedMarkName(const String& markName)
</span><span class="cx"> {
</span><del>-    ASSERT(isMainThread());
-    return restrictedMarkNamesToNavigationTimingFunctionMap().contains(markName);
</del><ins>+    return restrictedMarkFunctions.contains(markName);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> PerformanceUserTiming::PerformanceUserTiming(Performance& performance)
</span><span class="lines">@@ -136,11 +114,11 @@
</span><span class="cx"> ExceptionOr<double> PerformanceUserTiming::convertMarkToTimestamp(const String& mark) const
</span><span class="cx"> {
</span><span class="cx">     if (!isMainThread()) {
</span><del>-        if (isRestrictedMarkNameNonMainThread(mark))
</del><ins>+        if (restrictedMarkFunctions.contains(mark))
</ins><span class="cx">             return Exception { TypeError };
</span><span class="cx">     } else {
</span><del>-        if (auto function = restrictedMarkFunction(mark)) {
-            if (function == &PerformanceTiming::navigationStart)
</del><ins>+        if (auto function = restrictedMarkFunctions.tryGet(mark)) {
+            if (*function == &PerformanceTiming::navigationStart)
</ins><span class="cx">                 return 0.0;
</span><span class="cx"> 
</span><span class="cx">             // PerformanceTiming should always be non-null for the Document ScriptExecutionContext.
</span><span class="lines">@@ -147,7 +125,7 @@
</span><span class="cx">             ASSERT(m_performance.timing());
</span><span class="cx">             auto timing = m_performance.timing();
</span><span class="cx">             auto startTime = timing->navigationStart();
</span><del>-            auto endTime = ((*timing).*(function))();
</del><ins>+            auto endTime = ((*timing).*(*function))();
</ins><span class="cx">             if (!endTime)
</span><span class="cx">                 return Exception { InvalidAccessError };
</span><span class="cx">             return endTime - startTime;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformcocoaRemoteCommandListenerCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/cocoa/RemoteCommandListenerCocoa.mm (287231 => 287232)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/cocoa/RemoteCommandListenerCocoa.mm        2021-12-18 22:50:04 UTC (rev 287231)
+++ trunk/Source/WebCore/platform/cocoa/RemoteCommandListenerCocoa.mm   2021-12-18 23:57:08 UTC (rev 287232)
</span><span class="lines">@@ -55,9 +55,7 @@
</span><span class="cx">         { PlatformMediaSession::PreviousTrackCommand, MRMediaRemoteCommandPreviousTrack },
</span><span class="cx">     };
</span><span class="cx">     static constexpr SortedArrayMap map { mappings };
</span><del>-    if (auto* value = map.tryGet(command))
-        return *value;
-    return std::nullopt;
</del><ins>+    return makeOptionalFromPointer(map.tryGet(command));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> std::unique_ptr<RemoteCommandListenerCocoa> RemoteCommandListenerCocoa::create(RemoteCommandListenerClient& client)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontCascadecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FontCascade.cpp (287231 => 287232)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontCascade.cpp   2021-12-18 22:50:04 UTC (rev 287231)
+++ trunk/Source/WebCore/platform/graphics/FontCascade.cpp      2021-12-18 23:57:08 UTC (rev 287232)
</span><span class="lines">@@ -39,6 +39,7 @@
</span><span class="cx"> #include <wtf/MathExtras.h>
</span><span class="cx"> #include <wtf/NeverDestroyed.h>
</span><span class="cx"> #include <wtf/RobinHoodHashSet.h>
</span><ins>+#include <wtf/SortedArrayMap.h>
</ins><span class="cx"> #include <wtf/text/AtomStringHash.h>
</span><span class="cx"> #include <wtf/text/StringBuilder.h>
</span><span class="cx"> 
</span><span class="lines">@@ -373,43 +374,44 @@
</span><span class="cx">         return false;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    static NeverDestroyed map = MemoryCompactLookupOnlyRobinHoodHashSet<AtomString> {
-        "American Typewriter"_s,
-        "Arial Hebrew"_s,
-        "Chalkboard"_s,
-        "Cochin"_s,
-        "Corsiva Hebrew"_s,
-        "Courier"_s,
-        "Euphemia UCAS"_s,
-        "Geneva"_s,
-        "Gill Sans"_s,
-        "Hei"_s,
-        "Helvetica"_s,
-        "Hoefler Text"_s,
-        "InaiMathi"_s,
-        "Kai"_s,
-        "Lucida Grande"_s,
-        "Marker Felt"_s,
-        "Monaco"_s,
-        "Mshtakan"_s,
-        "New Peninim MT"_s,
-        "Osaka"_s,
-        "Raanana"_s,
-        "STHeiti"_s,
-        "Symbol"_s,
-        "Times"_s,
-        "Apple Braille"_s,
-        "Apple LiGothic"_s,
-        "Apple LiSung"_s,
-        "Apple Symbols"_s,
-        "AppleGothic"_s,
-        "AppleMyungjo"_s,
-        "#GungSeo"_s,
-        "#HeadLineA"_s,
-        "#PCMyungjo"_s,
-        "#PilGi"_s,
</del><ins>+    static constexpr ComparableASCIILiteral names[] = {
+        "#GungSeo",
+        "#HeadLineA",
+        "#PCMyungjo",
+        "#PilGi",
+        "American Typewriter",
+        "Apple Braille",
+        "Apple LiGothic",
+        "Apple LiSung",
+        "Apple Symbols",
+        "AppleGothic",
+        "AppleMyungjo",
+        "Arial Hebrew",
+        "Chalkboard",
+        "Cochin",
+        "Corsiva Hebrew",
+        "Courier",
+        "Euphemia UCAS",
+        "Geneva",
+        "Gill Sans",
+        "Hei",
+        "Helvetica",
+        "Hoefler Text",
+        "InaiMathi",
+        "Kai",
+        "Lucida Grande",
+        "Marker Felt",
+        "Monaco",
+        "Mshtakan",
+        "New Peninim MT",
+        "Osaka",
+        "Raanana",
+        "STHeiti",
+        "Symbol",
+        "Times",
</ins><span class="cx">     };
</span><del>-    return !map.get().contains(family);
</del><ins>+    static constexpr SortedArraySet set { names };
+    return !set.contains(family);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool FontCascade::fastAverageCharWidthIfAvailable(float& width) const
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontPlatformDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FontPlatformData.cpp (287231 => 287232)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontPlatformData.cpp      2021-12-18 22:50:04 UTC (rev 287231)
+++ trunk/Source/WebCore/platform/graphics/FontPlatformData.cpp 2021-12-18 23:57:08 UTC (rev 287232)
</span><span class="lines">@@ -21,6 +21,8 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "FontPlatformData.h"
</span><span class="cx"> 
</span><ins>+#include <wtf/SortedArrayMap.h>
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> FontPlatformData::FontPlatformData(WTF::HashTableDeletedValueType)
</span><span class="lines">@@ -32,13 +34,6 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-template<typename ValueType> static inline std::optional<ValueType> makeOptionalFromPointer(const ValueType* pointer)
-{
-    if (!pointer)
-        return std::nullopt;
-    return *pointer;
-}
-
</del><span class="cx"> FontPlatformData::FontPlatformData(float size, bool syntheticBold, bool syntheticOblique, FontOrientation orientation, FontWidthVariant widthVariant, TextRenderingMode textRenderingMode, const CreationData* creationData)
</span><span class="cx">     : m_size(size)
</span><span class="cx">     , m_orientation(orientation)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsHEVCUtilitiescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/HEVCUtilities.cpp (287231 => 287232)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/HEVCUtilities.cpp 2021-12-18 22:50:04 UTC (rev 287231)
+++ trunk/Source/WebCore/platform/graphics/HEVCUtilities.cpp    2021-12-18 23:57:08 UTC (rev 287232)
</span><span class="lines">@@ -312,13 +312,6 @@
</span><span class="cx">     return parameters;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-template<typename ValueType> static inline std::optional<ValueType> makeOptionalFromPointer(const ValueType* pointer)
-{
-    if (!pointer)
-        return std::nullopt;
-    return *pointer;
-}
-
</del><span class="cx"> static std::optional<DoViParameters::Codec> parseDoViCodecType(StringView string)
</span><span class="cx"> {
</span><span class="cx">     static constexpr std::pair<PackedASCIILowerCodes<uint32_t>, DoViParameters::Codec> typesArray[] = {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcAVAssetMIMETypeCachemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm (287231 => 287232)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm 2021-12-18 22:50:04 UTC (rev 287231)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm    2021-12-18 23:57:08 UTC (rev 287232)
</span><span class="lines">@@ -151,8 +151,8 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEBM_FORMAT_READER)
</span><span class="cx">     if (SourceBufferParserWebM::isWebMFormatReaderAvailable()) {
</span><del>-        auto webmTypes = SourceBufferParserWebM::webmMIMETypes();
-        cache.add(webmTypes.begin(), webmTypes.end());
</del><ins>+        auto types = SourceBufferParserWebM::supportedMIMETypes();
+        cache.add(types.begin(), types.end());
</ins><span class="cx">     }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcCDMInstanceFairPlayStreamingAVFObjCmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm (287231 => 287232)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm  2021-12-18 22:50:04 UTC (rev 287231)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm     2021-12-18 23:57:08 UTC (rev 287232)
</span><span class="lines">@@ -145,6 +145,7 @@
</span><span class="cx">     if (_parent)
</span><span class="cx">         _parent->sessionIdentifierChanged(session.contentProtectionSessionIdentifier);
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> - (void)contentKeySession:(AVContentKeySession *)session contentProtectionSessionIdentifierDidChangeForKeyGroup:(nullable AVContentKeyReportGroup *)reportGroup
</span><span class="cx"> {
</span><span class="cx">     // FIXME: Remove after rdar://57430747 is fixed
</span><span class="lines">@@ -298,9 +299,8 @@
</span><span class="cx">         if (!--m_numberOfExpectedResponses)
</span><span class="cx">             m_callback(WTFMove(m_responses));
</span><span class="cx">     }
</span><del>-    void addErrorResponse(AVContentKeyRequest* request, NSError* error)
</del><ins>+    void addErrorResponse(AVContentKeyRequest* request, NSError*)
</ins><span class="cx">     {
</span><del>-        UNUSED_PARAM(error);
</del><span class="cx">         m_responses.set(request, nullptr);
</span><span class="cx">         if (!--m_numberOfExpectedResponses)
</span><span class="cx">             m_callback(WTFMove(m_responses));
</span><span class="lines">@@ -536,9 +536,8 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CDMInstanceFairPlayStreamingAVFObjC::sessionIdentifierChanged(NSData *sessionIdentifier)
</del><ins>+void CDMInstanceFairPlayStreamingAVFObjC::sessionIdentifierChanged(NSData *)
</ins><span class="cx"> {
</span><del>-    UNUSED_PARAM(sessionIdentifier);
</del><span class="cx">     // No-op. If we are getting this callback, there are outstanding AVContentKeyRequestGroups which are managing their own
</span><span class="cx">     // session identifiers.
</span><span class="cx"> }
</span><span class="lines">@@ -917,9 +916,8 @@
</span><span class="cx">     m_updateLicenseCallback = WTFMove(callback);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CDMInstanceSessionFairPlayStreamingAVFObjC::loadSession(LicenseType licenseType, const String& sessionId, const String& origin, LoadSessionCallback&& callback)
</del><ins>+void CDMInstanceSessionFairPlayStreamingAVFObjC::loadSession(LicenseType licenseType, const String& sessionId, const String&, LoadSessionCallback&& callback)
</ins><span class="cx"> {
</span><del>-    UNUSED_PARAM(origin);
</del><span class="cx">     if (licenseType == LicenseType::PersistentUsageRecord) {
</span><span class="cx">         auto* storageURL = m_instance->storageURL();
</span><span class="cx">         if (!m_instance->persistentStateAllowed() || !storageURL) {
</span><span class="lines">@@ -1213,8 +1211,7 @@
</span><span class="cx">             auto keyIDs = keyIDsForRequest(request.get());
</span><span class="cx">             RefPtr<FragmentedSharedBuffer> keyID = WTFMove(keyIDs.first());
</span><span class="cx">             auto contentIdentifier = keyID->makeContiguous()->createNSData();
</span><del>-            [request makeStreamingContentKeyRequestDataForApp:appIdentifier.get() contentIdentifier:contentIdentifier.get() options:nil completionHandler:[keyID = WTFMove(keyID), aggregator] (NSData *contentKeyRequestData, NSError *error) mutable {
-                UNUSED_PARAM(error);
</del><ins>+            [request makeStreamingContentKeyRequestDataForApp:appIdentifier.get() contentIdentifier:contentIdentifier.get() options:nil completionHandler:[keyID = WTFMove(keyID), aggregator] (NSData *contentKeyRequestData, NSError *) mutable {
</ins><span class="cx">                 callOnMainThread([keyID = WTFMove(keyID), aggregator = WTFMove(aggregator), contentKeyRequestData = retainPtr(contentKeyRequestData)] () mutable {
</span><span class="cx">                     aggregator->requestsData.append({ WTFMove(keyID), WTFMove(contentKeyRequestData) });
</span><span class="cx">                 });
</span><span class="lines">@@ -1276,15 +1273,12 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CDMInstanceSessionFairPlayStreamingAVFObjC::didProvidePersistableRequest(AVContentKeyRequest *request)
</del><ins>+void CDMInstanceSessionFairPlayStreamingAVFObjC::didProvidePersistableRequest(AVContentKeyRequest *)
</ins><span class="cx"> {
</span><del>-    UNUSED_PARAM(request);
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CDMInstanceSessionFairPlayStreamingAVFObjC::didFailToProvideRequest(AVContentKeyRequest *request, NSError *error)
</span><span class="cx"> {
</span><del>-    UNUSED_PARAM(request);
-
</del><span class="cx">     // Rather than reject the update() promise when the CDM indicates that
</span><span class="cx">     // the key requires a higher level of security than it is currently able
</span><span class="cx">     // to provide, signal this state by "succeeding", but set the key status
</span><span class="lines">@@ -1312,7 +1306,6 @@
</span><span class="cx"> 
</span><span class="cx"> void CDMInstanceSessionFairPlayStreamingAVFObjC::requestDidSucceed(AVContentKeyRequest *request)
</span><span class="cx"> {
</span><del>-    UNUSED_PARAM(request);
</del><span class="cx">     if (m_updateResponseCollector) {
</span><span class="cx">         m_updateResponseCollector->addSuccessfulResponse(request, nullptr);
</span><span class="cx">         return;
</span><span class="lines">@@ -1371,10 +1364,8 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool CDMInstanceSessionFairPlayStreamingAVFObjC::shouldRetryRequestForReason(AVContentKeyRequest *request, NSString *reason)
</del><ins>+bool CDMInstanceSessionFairPlayStreamingAVFObjC::shouldRetryRequestForReason(AVContentKeyRequest *, NSString *)
</ins><span class="cx"> {
</span><del>-    UNUSED_PARAM(request);
-    UNUSED_PARAM(reason);
</del><span class="cx">     notImplemented();
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="lines">@@ -1393,9 +1384,8 @@
</span><span class="cx">         m_client->sessionIdChanged(m_sessionId);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CDMInstanceSessionFairPlayStreamingAVFObjC::groupSessionIdentifierChanged(AVContentKeyReportGroup* group, NSData *sessionIdentifier)
</del><ins>+void CDMInstanceSessionFairPlayStreamingAVFObjC::groupSessionIdentifierChanged(AVContentKeyReportGroup*, NSData *sessionIdentifier)
</ins><span class="cx"> {
</span><del>-    UNUSED_PARAM(group);
</del><span class="cx">     sessionIdentifierChanged(sessionIdentifier);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1452,9 +1442,8 @@
</span><span class="cx">         m_client->updateKeyStatuses(keyStatuses());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CDMInstanceSessionFairPlayStreamingAVFObjC::externalProtectionStatusDidChangeForContentKeyRequest(AVContentKeyRequest* request)
</del><ins>+void CDMInstanceSessionFairPlayStreamingAVFObjC::externalProtectionStatusDidChangeForContentKeyRequest(AVContentKeyRequest*)
</ins><span class="cx"> {
</span><del>-    UNUSED_PARAM(request);
</del><span class="cx">     if (!m_client)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -1461,7 +1450,7 @@
</span><span class="cx">     updateProtectionStatusForDisplayID(m_client->displayID());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-std::optional<CDMKeyStatus> CDMInstanceSessionFairPlayStreamingAVFObjC::protectionStatusForDisplayID(AVContentKeyRequest *request, std::optional<PlatformDisplayID> displayID) const
</del><ins>+std::optional<CDMKeyStatus> CDMInstanceSessionFairPlayStreamingAVFObjC::protectionStatusForDisplayID(AVContentKeyRequest *request, std::optional<PlatformDisplayID>) const
</ins><span class="cx"> {
</span><span class="cx"> #if HAVE(AVCONTENTKEYREQUEST_PENDING_PROTECTION_STATUS)
</span><span class="cx">     if ([request respondsToSelector:@selector(externalContentProtectionStatus)]) {
</span><span class="lines">@@ -1478,7 +1467,6 @@
</span><span class="cx">     // across all displays. Replace the below with explicit APIs to query the per-display HDCP status in the UIProcess
</span><span class="cx">     // and to query the HDCP level required by each AVContentKeyRequest, and do the comparison between the two in the
</span><span class="cx">     // WebProcess.
</span><del>-    UNUSED_PARAM(displayID);
</del><span class="cx">     if ([request respondsToSelector:@selector(willOutputBeObscuredDueToInsufficientExternalProtectionForDisplays:)]) {
</span><span class="cx"> 
</span><span class="cx">         // willOutputBeObscuredDueToInsufficientExternalProtectionForDisplays will always return "YES" prior to
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgUTIRegistrycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/UTIRegistry.cpp (287231 => 287232)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/UTIRegistry.cpp        2021-12-18 22:50:04 UTC (rev 287231)
+++ trunk/Source/WebCore/platform/graphics/cg/UTIRegistry.cpp   2021-12-18 23:57:08 UTC (rev 287232)
</span><span class="lines">@@ -41,7 +41,7 @@
</span><span class="cx"> const MemoryCompactLookupOnlyRobinHoodHashSet<String>& defaultSupportedImageTypes()
</span><span class="cx"> {
</span><span class="cx">     static NeverDestroyed defaultSupportedImageTypes = [] {
</span><del>-        HashSet<String> defaultSupportedImageTypes = {
</del><ins>+        static constexpr std::array defaultSupportedImageTypes = {
</ins><span class="cx">             "com.compuserve.gif"_s,
</span><span class="cx">             "com.microsoft.bmp"_s,
</span><span class="cx">             "com.microsoft.cur"_s,
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscocoaSourceBufferParserWebMcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cocoa/SourceBufferParserWebM.cpp (287231 => 287232)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cocoa/SourceBufferParserWebM.cpp  2021-12-18 22:50:04 UTC (rev 287231)
+++ trunk/Source/WebCore/platform/graphics/cocoa/SourceBufferParserWebM.cpp     2021-12-18 23:57:08 UTC (rev 287232)
</span><span class="lines">@@ -553,19 +553,21 @@
</span><span class="cx">     webm::TrackEntry m_track;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-const HashSet<String, ASCIICaseInsensitiveHash>& SourceBufferParserWebM::webmMIMETypes()
</del><ins>+Span<const ASCIILiteral> SourceBufferParserWebM::supportedMIMETypes()
</ins><span class="cx"> {
</span><del>-    static NeverDestroyed types = [] {
-        HashSet<String, ASCIICaseInsensitiveHash> types;
</del><ins>+#if !(ENABLE(VP9) || ENABLE(VORBIS) || ENABLE(OPUS))
+    return { };
+#else
+    static constexpr std::array types {
</ins><span class="cx"> #if ENABLE(VP9)
</span><del>-        types.add("video/webm");
</del><ins>+        "video/webm"_s,
</ins><span class="cx"> #endif
</span><span class="cx"> #if ENABLE(VORBIS) || ENABLE(OPUS)
</span><del>-        types.add("audio/webm");
</del><ins>+        "audio/webm"_s,
</ins><span class="cx"> #endif
</span><del>-        return types;
-    }();
</del><ins>+    };
</ins><span class="cx">     return types;
</span><ins>+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static bool canLoadFormatReader()
</span><span class="lines">@@ -806,7 +808,6 @@
</span><span class="cx"> 
</span><span class="cx"> Status SourceBufferParserWebM::OnElementBegin(const ElementMetadata& metadata, Action* action)
</span><span class="cx"> {
</span><del>-    UNUSED_PARAM(metadata);
</del><span class="cx">     ASSERT(action);
</span><span class="cx">     if (!action)
</span><span class="cx">         return Status(Status::kNotEnoughMemory);
</span><span class="lines">@@ -879,7 +880,6 @@
</span><span class="cx"> 
</span><span class="cx"> Status SourceBufferParserWebM::OnElementEnd(const ElementMetadata& metadata)
</span><span class="cx"> {
</span><del>-    UNUSED_PARAM(metadata);
</del><span class="cx">     INFO_LOG_IF_POSSIBLE(LOGIDENTIFIER);
</span><span class="cx"> 
</span><span class="cx">     auto oldState = m_state;
</span><span class="lines">@@ -919,9 +919,8 @@
</span><span class="cx">     return Status(Status::kOkCompleted);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Status SourceBufferParserWebM::OnEbml(const ElementMetadata& metadata, const Ebml& ebml)
</del><ins>+Status SourceBufferParserWebM::OnEbml(const ElementMetadata&, const Ebml& ebml)
</ins><span class="cx"> {
</span><del>-    UNUSED_PARAM(metadata);
</del><span class="cx">     INFO_LOG_IF_POSSIBLE(LOGIDENTIFIER);
</span><span class="cx"> 
</span><span class="cx">     if (ebml.doc_type.is_present() && ebml.doc_type.value().compare("webm"))
</span><span class="lines">@@ -939,9 +938,8 @@
</span><span class="cx">     return Status(Status::kOkCompleted);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Status SourceBufferParserWebM::OnSegmentBegin(const ElementMetadata& metadata, Action* action)
</del><ins>+Status SourceBufferParserWebM::OnSegmentBegin(const ElementMetadata&, Action* action)
</ins><span class="cx"> {
</span><del>-    UNUSED_PARAM(metadata);
</del><span class="cx">     INFO_LOG_IF_POSSIBLE(LOGIDENTIFIER);
</span><span class="cx"> 
</span><span class="cx">     if (!m_initializationSegmentEncountered) {
</span><span class="lines">@@ -957,9 +955,8 @@
</span><span class="cx">     return Status(Status::kOkCompleted);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Status SourceBufferParserWebM::OnInfo(const ElementMetadata& metadata, const Info& info)
</del><ins>+Status SourceBufferParserWebM::OnInfo(const ElementMetadata&, const Info& info)
</ins><span class="cx"> {
</span><del>-    UNUSED_PARAM(metadata);
</del><span class="cx">     INFO_LOG_IF_POSSIBLE(LOGIDENTIFIER);
</span><span class="cx"> 
</span><span class="cx">     if (!m_initializationSegmentEncountered || !m_initializationSegment) {
</span><span class="lines">@@ -974,9 +971,8 @@
</span><span class="cx">     return Status(Status::kOkCompleted);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Status SourceBufferParserWebM::OnClusterBegin(const ElementMetadata& metadata, const Cluster& cluster, Action* action)
</del><ins>+Status SourceBufferParserWebM::OnClusterBegin(const ElementMetadata&, const Cluster& cluster, Action* action)
</ins><span class="cx"> {
</span><del>-    UNUSED_PARAM(metadata);
</del><span class="cx">     INFO_LOG_IF_POSSIBLE(LOGIDENTIFIER);
</span><span class="cx"> 
</span><span class="cx">     ASSERT(action);
</span><span class="lines">@@ -991,9 +987,8 @@
</span><span class="cx">     return Status(Status::kOkCompleted);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Status SourceBufferParserWebM::OnTrackEntry(const ElementMetadata& metadata, const TrackEntry& trackEntry)
</del><ins>+Status SourceBufferParserWebM::OnTrackEntry(const ElementMetadata&, const TrackEntry& trackEntry)
</ins><span class="cx"> {
</span><del>-    UNUSED_PARAM(metadata);
</del><span class="cx">     if (!trackEntry.track_type.is_present() || !trackEntry.codec_id.is_present())
</span><span class="cx">         return Status(Status::kOkCompleted);
</span><span class="cx"> 
</span><span class="lines">@@ -1002,12 +997,12 @@
</span><span class="cx"> 
</span><span class="cx">     ALWAYS_LOG_IF_POSSIBLE(LOGIDENTIFIER, trackType, ", codec ", codecId);
</span><span class="cx"> 
</span><del>-    if (trackType == TrackType::kVideo && !supportedVideoCodecs().contains(codecId)) {
</del><ins>+    if (trackType == TrackType::kVideo && !isSupportedVideoCodec(codecId)) {
</ins><span class="cx">         ERROR_LOG_IF_POSSIBLE(LOGIDENTIFIER, "Encountered unsupported video codec ID ", codecId);
</span><span class="cx">         return Status(Status::Code(ErrorCode::UnsupportedVideoCodec));
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (trackType == TrackType::kAudio && !supportedAudioCodecs().contains(codecId)) {
</del><ins>+    if (trackType == TrackType::kAudio && !isSupportedAudioCodec(codecId)) {
</ins><span class="cx">         ERROR_LOG_IF_POSSIBLE(LOGIDENTIFIER, "Encountered unsupported audio codec ID ", codecId);
</span><span class="cx">         return Status(Status::Code(ErrorCode::UnsupportedAudioCodec));
</span><span class="cx">     }
</span><span class="lines">@@ -1073,9 +1068,8 @@
</span><span class="cx">     return Status(Status::kOkCompleted);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-webm::Status SourceBufferParserWebM::OnBlockBegin(const ElementMetadata& metadata, const Block& block, Action* action)
</del><ins>+webm::Status SourceBufferParserWebM::OnBlockBegin(const ElementMetadata&, const Block& block, Action* action)
</ins><span class="cx"> {
</span><del>-    UNUSED_PARAM(metadata);
</del><span class="cx">     INFO_LOG_IF_POSSIBLE(LOGIDENTIFIER);
</span><span class="cx"> 
</span><span class="cx">     ASSERT(action);
</span><span class="lines">@@ -1089,10 +1083,8 @@
</span><span class="cx">     return Status(Status::kOkCompleted);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-webm::Status SourceBufferParserWebM::OnBlockEnd(const ElementMetadata& metadata, const Block& block)
</del><ins>+webm::Status SourceBufferParserWebM::OnBlockEnd(const ElementMetadata&, const Block&)
</ins><span class="cx"> {
</span><del>-    UNUSED_PARAM(metadata);
-    UNUSED_PARAM(block);
</del><span class="cx">     INFO_LOG_IF_POSSIBLE(LOGIDENTIFIER);
</span><span class="cx"> 
</span><span class="cx">     m_currentBlock = std::nullopt;
</span><span class="lines">@@ -1100,9 +1092,8 @@
</span><span class="cx">     return Status(Status::kOkCompleted);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-webm::Status SourceBufferParserWebM::OnSimpleBlockBegin(const ElementMetadata& metadata, const SimpleBlock& block, Action* action)
</del><ins>+webm::Status SourceBufferParserWebM::OnSimpleBlockBegin(const ElementMetadata&, const SimpleBlock& block, Action* action)
</ins><span class="cx"> {
</span><del>-    UNUSED_PARAM(metadata);
</del><span class="cx">     INFO_LOG_IF_POSSIBLE(LOGIDENTIFIER);
</span><span class="cx"> 
</span><span class="cx">     ASSERT(action);
</span><span class="lines">@@ -1116,21 +1107,17 @@
</span><span class="cx">     return Status(Status::kOkCompleted);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-webm::Status SourceBufferParserWebM::OnSimpleBlockEnd(const ElementMetadata& metadata, const SimpleBlock& block)
</del><ins>+webm::Status SourceBufferParserWebM::OnSimpleBlockEnd(const ElementMetadata&, const SimpleBlock&)
</ins><span class="cx"> {
</span><del>-    UNUSED_PARAM(metadata);
</del><span class="cx">     INFO_LOG_IF_POSSIBLE(LOGIDENTIFIER);
</span><span class="cx"> 
</span><del>-    UNUSED_PARAM(block);
-
</del><span class="cx">     m_currentBlock = std::nullopt;
</span><span class="cx"> 
</span><span class="cx">     return Status(Status::kOkCompleted);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-webm::Status SourceBufferParserWebM::OnBlockGroupBegin(const webm::ElementMetadata& metadata, webm::Action* action)
</del><ins>+webm::Status SourceBufferParserWebM::OnBlockGroupBegin(const webm::ElementMetadata&, webm::Action* action)
</ins><span class="cx"> {
</span><del>-    UNUSED_PARAM(metadata);
</del><span class="cx">     INFO_LOG_IF_POSSIBLE(LOGIDENTIFIER);
</span><span class="cx"> 
</span><span class="cx">     ASSERT(action);
</span><span class="lines">@@ -1141,9 +1128,8 @@
</span><span class="cx">     return Status(Status::kOkCompleted);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-webm::Status SourceBufferParserWebM::OnBlockGroupEnd(const webm::ElementMetadata& metadata, const webm::BlockGroup& blockGroup)
</del><ins>+webm::Status SourceBufferParserWebM::OnBlockGroupEnd(const webm::ElementMetadata&, const webm::BlockGroup& blockGroup)
</ins><span class="cx"> {
</span><del>-    UNUSED_PARAM(metadata);
</del><span class="cx">     INFO_LOG_IF_POSSIBLE(LOGIDENTIFIER);
</span><span class="cx">     if (blockGroup.block.is_present() && blockGroup.discard_padding.is_present()) {
</span><span class="cx">         auto trackNumber = blockGroup.block.value().track_number;
</span><span class="lines">@@ -1527,16 +1513,14 @@
</span><span class="cx">     m_minimumAudioSampleDuration = duration;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-const MemoryCompactLookupOnlyRobinHoodHashSet<String>& SourceBufferParserWebM::supportedVideoCodecs()
</del><ins>+bool SourceBufferParserWebM::isSupportedVideoCodec(StringView name)
</ins><span class="cx"> {
</span><del>-    static NeverDestroyed codecs = MemoryCompactLookupOnlyRobinHoodHashSet<String> { "V_VP8"_s, "V_VP9"_s };
-    return codecs;
</del><ins>+    return name == "V_VP8" || name == "V_VP9";
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-const MemoryCompactLookupOnlyRobinHoodHashSet<String>& SourceBufferParserWebM::supportedAudioCodecs()
</del><ins>+bool SourceBufferParserWebM::isSupportedAudioCodec(StringView name)
</ins><span class="cx"> {
</span><del>-    static NeverDestroyed codecs = MemoryCompactLookupOnlyRobinHoodHashSet<String> { "A_VORBIS"_s, "A_OPUS"_s };
-    return codecs;
</del><ins>+    return name == "A_VORBIS" || name == "A_OPUS";
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscocoaSourceBufferParserWebMh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cocoa/SourceBufferParserWebM.h (287231 => 287232)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cocoa/SourceBufferParserWebM.h    2021-12-18 22:50:04 UTC (rev 287231)
+++ trunk/Source/WebCore/platform/graphics/cocoa/SourceBufferParserWebM.h       2021-12-18 23:57:08 UTC (rev 287232)
</span><span class="lines">@@ -35,14 +35,8 @@
</span><span class="cx"> #include <webm/callback.h>
</span><span class="cx"> #include <webm/status.h>
</span><span class="cx"> #include <webm/vp9_header_parser.h>
</span><del>-#include <wtf/Box.h>
-#include <wtf/Function.h>
-#include <wtf/MediaTime.h>
-#include <wtf/RobinHoodHashSet.h>
</del><span class="cx"> #include <wtf/UniqueRef.h>
</span><span class="cx"> #include <wtf/Vector.h>
</span><del>-#include <wtf/text/AtomString.h>
-#include <wtf/text/WTFString.h>
</del><span class="cx"> 
</span><span class="cx"> typedef const struct opaqueCMFormatDescription* CMFormatDescriptionRef;
</span><span class="cx"> typedef struct OpaqueCMBlockBuffer *CMBlockBufferRef;
</span><span class="lines">@@ -53,8 +47,6 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class MediaSampleAVFObjC;
-
</del><span class="cx"> class SourceBufferParserWebM : public SourceBufferParser, private webm::Callback {
</span><span class="cx">     WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><span class="lines">@@ -62,7 +54,7 @@
</span><span class="cx"> 
</span><span class="cx">     static bool isWebMFormatReaderAvailable();
</span><span class="cx">     static MediaPlayerEnums::SupportsType isContentTypeSupported(const ContentType&);
</span><del>-    static const HashSet<String, ASCIICaseInsensitiveHash>& webmMIMETypes();
</del><ins>+    static Span<const ASCIILiteral> supportedMIMETypes();
</ins><span class="cx">     WEBCORE_EXPORT static RefPtr<SourceBufferParserWebM> create(const ContentType&);
</span><span class="cx"> 
</span><span class="cx">     SourceBufferParserWebM();
</span><span class="lines">@@ -256,8 +248,8 @@
</span><span class="cx"> 
</span><span class="cx">     TrackData* trackDataForTrackNumber(uint64_t);
</span><span class="cx"> 
</span><del>-    static const MemoryCompactLookupOnlyRobinHoodHashSet<String>& supportedVideoCodecs();
-    static const MemoryCompactLookupOnlyRobinHoodHashSet<String>& supportedAudioCodecs();
</del><ins>+    static bool isSupportedVideoCodec(StringView);
+    static bool isSupportedAudioCodec(StringView);
</ins><span class="cx"> 
</span><span class="cx">     // webm::Callback
</span><span class="cx">     webm::Status OnElementBegin(const webm::ElementMetadata&, webm::Action*) final;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgSVGResourcescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/SVGResources.cpp (287231 => 287232)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/SVGResources.cpp      2021-12-18 22:50:04 UTC (rev 287231)
+++ trunk/Source/WebCore/rendering/svg/SVGResources.cpp 2021-12-18 23:57:08 UTC (rev 287232)
</span><span class="lines">@@ -48,100 +48,105 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static MemoryCompactLookupOnlyRobinHoodHashSet<AtomString> tagSet(Span<decltype(SVGNames::aTag)* const> tags)
+{
+    MemoryCompactLookupOnlyRobinHoodHashSet<AtomString> set;
+    set.reserveInitialCapacity(tags.size());
+    for (auto& tag : tags)
+        set.add(tag->get().localName());
+    return set;
+}
+
</ins><span class="cx"> static const MemoryCompactLookupOnlyRobinHoodHashSet<AtomString>& clipperFilterMaskerTags()
</span><span class="cx"> {
</span><del>-    static NeverDestroyed<MemoryCompactLookupOnlyRobinHoodHashSet<AtomString>> s_tagList;
-    if (s_tagList.get().isEmpty()) {
</del><ins>+    static constexpr std::array tags {
</ins><span class="cx">         // "container elements": http://www.w3.org/TR/SVG11/intro.html#TermContainerElement
</span><span class="cx">         // "graphics elements" : http://www.w3.org/TR/SVG11/intro.html#TermGraphicsElement
</span><del>-        s_tagList.get().add(SVGNames::aTag->localName());
-        s_tagList.get().add(SVGNames::circleTag->localName());
-        s_tagList.get().add(SVGNames::ellipseTag->localName());
-        s_tagList.get().add(SVGNames::glyphTag->localName());
-        s_tagList.get().add(SVGNames::gTag->localName());
-        s_tagList.get().add(SVGNames::imageTag->localName());
-        s_tagList.get().add(SVGNames::lineTag->localName());
-        s_tagList.get().add(SVGNames::markerTag->localName());
-        s_tagList.get().add(SVGNames::maskTag->localName());
-        s_tagList.get().add(SVGNames::missing_glyphTag->localName());
-        s_tagList.get().add(SVGNames::pathTag->localName());
-        s_tagList.get().add(SVGNames::polygonTag->localName());
-        s_tagList.get().add(SVGNames::polylineTag->localName());
-        s_tagList.get().add(SVGNames::rectTag->localName());
-        s_tagList.get().add(SVGNames::svgTag->localName());
-        s_tagList.get().add(SVGNames::textTag->localName());
-        s_tagList.get().add(SVGNames::useTag->localName());
</del><ins>+        &SVGNames::aTag,
+        &SVGNames::circleTag,
+        &SVGNames::ellipseTag,
+        &SVGNames::glyphTag,
+        &SVGNames::gTag,
+        &SVGNames::imageTag,
+        &SVGNames::lineTag,
+        &SVGNames::markerTag,
+        &SVGNames::maskTag,
+        &SVGNames::missing_glyphTag,
+        &SVGNames::pathTag,
+        &SVGNames::polygonTag,
+        &SVGNames::polylineTag,
+        &SVGNames::rectTag,
+        &SVGNames::svgTag,
+        &SVGNames::textTag,
+        &SVGNames::useTag,
</ins><span class="cx"> 
</span><span class="cx">         // Not listed in the definitions is the clipPath element, the SVG spec says though:
</span><span class="cx">         // The "clipPath" element or any of its children can specify property "clip-path".
</span><span class="cx">         // So we have to add clipPathTag here, otherwhise clip-path on clipPath will fail.
</span><span class="cx">         // (Already mailed SVG WG, waiting for a solution)
</span><del>-        s_tagList.get().add(SVGNames::clipPathTag->localName());
</del><ins>+        &SVGNames::clipPathTag,
</ins><span class="cx"> 
</span><span class="cx">         // Not listed in the definitions are the text content elements, though filter/clipper/masker on tspan/text/.. is allowed.
</span><span class="cx">         // (Already mailed SVG WG, waiting for a solution)
</span><del>-        s_tagList.get().add(SVGNames::altGlyphTag->localName());
-        s_tagList.get().add(SVGNames::textPathTag->localName());
-        s_tagList.get().add(SVGNames::trefTag->localName());
-        s_tagList.get().add(SVGNames::tspanTag->localName());
</del><ins>+        &SVGNames::altGlyphTag,
+        &SVGNames::textPathTag,
+        &SVGNames::trefTag,
+        &SVGNames::tspanTag,
</ins><span class="cx"> 
</span><span class="cx">         // Not listed in the definitions is the foreignObject element, but clip-path
</span><span class="cx">         // is a supported attribute.
</span><del>-        s_tagList.get().add(SVGNames::foreignObjectTag->localName());
</del><ins>+        &SVGNames::foreignObjectTag,
</ins><span class="cx"> 
</span><span class="cx">         // Elements that we ignore, as it doesn't make any sense.
</span><span class="cx">         // defs, pattern, switch (FIXME: Mail SVG WG about these)
</span><span class="cx">         // symbol (is converted to a svg element, when referenced by use, we can safely ignore it.)
</span><del>-    }
-
-    return s_tagList;
</del><ins>+    };
+    static NeverDestroyed set = tagSet(tags);
+    return set;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static const MemoryCompactLookupOnlyRobinHoodHashSet<AtomString>& markerTags()
</span><span class="cx"> {
</span><del>-    static NeverDestroyed<MemoryCompactLookupOnlyRobinHoodHashSet<AtomString>> s_tagList;
-    if (s_tagList.get().isEmpty()) {
-        s_tagList.get().add(SVGNames::lineTag->localName());
-        s_tagList.get().add(SVGNames::pathTag->localName());
-        s_tagList.get().add(SVGNames::polygonTag->localName());
-        s_tagList.get().add(SVGNames::polylineTag->localName());
-    }
-
-    return s_tagList;
</del><ins>+    static constexpr std::array tags {
+        &SVGNames::lineTag,
+        &SVGNames::pathTag,
+        &SVGNames::polygonTag,
+        &SVGNames::polylineTag,
+    };
+    static NeverDestroyed set = tagSet(tags);
+    return set;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static const MemoryCompactLookupOnlyRobinHoodHashSet<AtomString>& fillAndStrokeTags()
</span><span class="cx"> {
</span><del>-    static NeverDestroyed<MemoryCompactLookupOnlyRobinHoodHashSet<AtomString>> s_tagList;
-    if (s_tagList.get().isEmpty()) {
-        s_tagList.get().add(SVGNames::altGlyphTag->localName());
-        s_tagList.get().add(SVGNames::circleTag->localName());
-        s_tagList.get().add(SVGNames::ellipseTag->localName());
-        s_tagList.get().add(SVGNames::lineTag->localName());
-        s_tagList.get().add(SVGNames::pathTag->localName());
-        s_tagList.get().add(SVGNames::polygonTag->localName());
-        s_tagList.get().add(SVGNames::polylineTag->localName());
-        s_tagList.get().add(SVGNames::rectTag->localName());
-        s_tagList.get().add(SVGNames::textTag->localName());
-        s_tagList.get().add(SVGNames::textPathTag->localName());
-        s_tagList.get().add(SVGNames::trefTag->localName());
-        s_tagList.get().add(SVGNames::tspanTag->localName());
-    }
-
-    return s_tagList;
</del><ins>+    static constexpr std::array tags {
+        &SVGNames::altGlyphTag,
+        &SVGNames::circleTag,
+        &SVGNames::ellipseTag,
+        &SVGNames::lineTag,
+        &SVGNames::pathTag,
+        &SVGNames::polygonTag,
+        &SVGNames::polylineTag,
+        &SVGNames::rectTag,
+        &SVGNames::textTag,
+        &SVGNames::textPathTag,
+        &SVGNames::trefTag,
+        &SVGNames::tspanTag,
+    };
+    static NeverDestroyed set = tagSet(tags);
+    return set;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static const MemoryCompactLookupOnlyRobinHoodHashSet<AtomString>& chainableResourceTags()
</span><span class="cx"> {
</span><del>-    static NeverDestroyed<MemoryCompactLookupOnlyRobinHoodHashSet<AtomString>> s_tagList;
-    if (s_tagList.get().isEmpty()) {
-        s_tagList.get().add(SVGNames::linearGradientTag->localName());
-        s_tagList.get().add(SVGNames::filterTag->localName());
-        s_tagList.get().add(SVGNames::patternTag->localName());
-        s_tagList.get().add(SVGNames::radialGradientTag->localName());
-    }
-
-    return s_tagList;
</del><ins>+    static constexpr std::array tags {
+        &SVGNames::linearGradientTag,
+        &SVGNames::filterTag,
+        &SVGNames::patternTag,
+        &SVGNames::radialGradientTag,
+    };
+    static NeverDestroyed set = tagSet(tags);
+    return set;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static inline String targetReferenceFromResource(SVGElement& element)
</span></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (287231 => 287232)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2021-12-18 22:50:04 UTC (rev 287231)
+++ trunk/Source/WebKit/ChangeLog       2021-12-18 23:57:08 UTC (rev 287232)
</span><span class="lines">@@ -1,3 +1,26 @@
</span><ins>+2021-12-18  Darin Adler  <darin@apple.com>
+
+        Hash tables, read/write, and heap memory are used unnecessarily, which may hurt performance
+        https://bugs.webkit.org/show_bug.cgi?id=234438
+
+        Reviewed by Anders Carlsson.
+
+        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
+        (WebKit::ResourceLoadStatisticsDatabaseStore::sortedTables): Simplify unnecessarily complicated
+        expression to initialize the Span.
+
+        * Shared/Cocoa/DefaultWebBrowserChecks.h: Return a Span instead of an optional Vector.
+        * Shared/Cocoa/DefaultWebBrowserChecks.mm:
+        (WebKit::appBoundDomainsForTesting): Renamed from getAppBoundDomainsTesting to fit WebKit
+        coding style a bit better, and be a little more grammatical. Removed an un-needed HashMap
+        that had only a single entry, used a NeverDestroyed std::array rather than a Vector so we
+        don't use any heap or read/write memory.
+
+        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
+        (WebKit::WebsiteDataStore::addTestDomains const): Rewrite to use the function above.
+        Fewer special cases needed since we are just using an empty Span, which efficiently
+        does nothing, so no need to have a distinct null value.
+
</ins><span class="cx"> 2021-12-18  Chris Dumez  <cdumez@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Move CacheStorage engines from NetworkProcess to NetworkSession
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessClassifierResourceLoadStatisticsDatabaseStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp (287231 => 287232)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp    2021-12-18 22:50:04 UTC (rev 287231)
+++ trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp       2021-12-18 23:57:08 UTC (rev 287232)
</span><span class="lines">@@ -288,7 +288,7 @@
</span><span class="cx">         "OperatingDates"_s
</span><span class="cx">     };
</span><span class="cx"> 
</span><del>-    return { sortedTables.data(), sortedTables.size() };
</del><ins>+    return sortedTables;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template <typename ContainerType>
</span></span></pre></div>
<a id="trunkSourceWebKitSharedCocoaDefaultWebBrowserChecksh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/Cocoa/DefaultWebBrowserChecks.h (287231 => 287232)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/Cocoa/DefaultWebBrowserChecks.h       2021-12-18 22:50:04 UTC (rev 287231)
+++ trunk/Source/WebKit/Shared/Cocoa/DefaultWebBrowserChecks.h  2021-12-18 23:57:08 UTC (rev 287232)
</span><span class="lines">@@ -38,7 +38,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool hasRequestedCrossWebsiteTrackingPermission();
</span><span class="cx"> bool hasProhibitedUsageStrings();
</span><del>-std::optional<Vector<WebCore::RegistrableDomain>> getAppBoundDomainsTesting(const String&);
</del><ins>+Span<const WebCore::RegistrableDomain> appBoundDomainsForTesting(const String&);
</ins><span class="cx"> bool isRunningTest(const String& bundleID);
</span><span class="cx"> void determineITPState();
</span><span class="cx"> bool doesAppHaveITPEnabled();
</span></span></pre></div>
<a id="trunkSourceWebKitSharedCocoaDefaultWebBrowserChecksmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/Cocoa/DefaultWebBrowserChecks.mm (287231 => 287232)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/Cocoa/DefaultWebBrowserChecks.mm      2021-12-18 22:50:04 UTC (rev 287231)
+++ trunk/Source/WebKit/Shared/Cocoa/DefaultWebBrowserChecks.mm 2021-12-18 23:57:08 UTC (rev 287232)
</span><span class="lines">@@ -35,7 +35,6 @@
</span><span class="cx"> #import <WebCore/VersionChecks.h>
</span><span class="cx"> #import <wtf/HashMap.h>
</span><span class="cx"> #import <wtf/NeverDestroyed.h>
</span><del>-#import <wtf/RobinHoodHashMap.h>
</del><span class="cx"> #import <wtf/RunLoop.h>
</span><span class="cx"> #import <wtf/WorkQueue.h>
</span><span class="cx"> #import <wtf/cocoa/Entitlements.h>
</span><span class="lines">@@ -50,20 +49,15 @@
</span><span class="cx">     return bundleID == "com.apple.WebKit.TestWebKitAPI"_s || bundleID == "com.apple.WebKit.WebKitTestRunner"_s || bundleID == "org.webkit.WebKitTestRunnerApp"_s;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-std::optional<Vector<WebCore::RegistrableDomain>> getAppBoundDomainsTesting(const String& bundleID)
</del><ins>+Span<const WebCore::RegistrableDomain> appBoundDomainsForTesting(const String& bundleID)
</ins><span class="cx"> {
</span><del>-    if (bundleID.isNull())
-        return std::nullopt;
-
-    static NeverDestroyed appBoundDomainList = MemoryCompactLookupOnlyRobinHoodHashMap<String, Vector<WebCore::RegistrableDomain>> {
-        {"inAppBrowserPrivacyTestIdentifier"_s, Vector<WebCore::RegistrableDomain> { WebCore::RegistrableDomain::uncheckedCreateFromRegistrableDomainString("127.0.0.1") }},
-    };
-
-    auto appBoundDomainIter = appBoundDomainList->find(bundleID);
-    if (appBoundDomainIter != appBoundDomainList->end())
-        return appBoundDomainIter->value;
-
-    return std::nullopt;
</del><ins>+    if (bundleID == "inAppBrowserPrivacyTestIdentifier") {
+        static NeverDestroyed domains = std::array {
+            WebCore::RegistrableDomain::uncheckedCreateFromRegistrableDomainString("127.0.0.1"_s),
+        };
+        return domains.get();
+    }
+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ASSERT_ENABLED
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessWebsiteDataCocoaWebsiteDataStoreCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm (287231 => 287232)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm 2021-12-18 22:50:04 UTC (rev 287231)
+++ trunk/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm    2021-12-18 23:57:08 UTC (rev 287232)
</span><span class="lines">@@ -519,12 +519,8 @@
</span><span class="cx"> void WebsiteDataStore::addTestDomains() const
</span><span class="cx"> {
</span><span class="cx">     if (appBoundDomains().isEmpty()) {
</span><del>-        auto bundleID = WebCore::applicationBundleIdentifier();
-        auto appBoundDomainsTesting = getAppBoundDomainsTesting(bundleID);
-        if (appBoundDomainsTesting) {
-            for (auto& domain : *appBoundDomainsTesting)
-                appBoundDomains().add(domain);
-        }
</del><ins>+        for (auto& domain : appBoundDomainsForTesting(WebCore::applicationBundleIdentifier()))
+            appBoundDomains().add(domain);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>