Introduce MainThreadNeverDestroyed / MainThreadLazyNeverDestroyed
authorysuzuki@apple.com <ysuzuki@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 May 2020 19:47:39 +0000 (19:47 +0000)
committerysuzuki@apple.com <ysuzuki@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 May 2020 19:47:39 +0000 (19:47 +0000)
https://bugs.webkit.org/show_bug.cgi?id=211264

Reviewed by Mark Lam.

Source/WebCore:

No behavior change. Adding assertions additionally.

* Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.cpp:
(WebCore::stringForPlaybackTargetAvailability):
* Modules/encryptedmedia/InitDataRegistry.cpp:
(WebCore::InitDataRegistry::cencName):
(WebCore::InitDataRegistry::keyidsName):
(WebCore::InitDataRegistry::webmName):
* Modules/mediacontrols/MediaControlsHost.cpp:
(WebCore::MediaControlsHost::automaticKeyword):
(WebCore::MediaControlsHost::forcedOnlyKeyword):
(WebCore::alwaysOnKeyword):
(WebCore::manualKeyword):
* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::kind const):
(WebCore::MediaStreamTrack::contentHint const):
* Modules/mediastream/RTCDataChannel.cpp:
(WebCore::blobKeyword):
(WebCore::arraybufferKeyword):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::liveRegionRelevant const):
* dom/ConstantPropertyMap.cpp:
(WebCore::ConstantPropertyMap::nameForProperty const):
* dom/Document.cpp:
(WebCore::Document::validateCustomElementName):
* dom/InlineStyleSheetOwner.cpp:
(WebCore::isValidCSSContentType):
* dom/MutationRecord.cpp:
* dom/make_names.pl:
(printNamesHeaderFile):
(printNamesCppFile):
* html/Autocapitalize.cpp:
(WebCore::stringForAutocapitalizeType):
* html/Autofill.cpp:
(WebCore::isContactToken):
(WebCore::AutofillData::createFromHTMLFormControlElement):
* html/BaseCheckableInputType.cpp:
(WebCore::BaseCheckableInputType::fallbackValue const):
* html/BaseChooserOnlyDateAndTimeInputType.cpp:
(WebCore::BaseChooserOnlyDateAndTimeInputType::createShadowSubtree):
* html/ColorInputType.cpp:
(WebCore::ColorInputType::createShadowSubtree):
* html/FileInputType.cpp:
(WebCore::UploadButtonElement::UploadButtonElement):
* html/FormController.cpp:
(WebCore::FormKeyGenerator::formKey):
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::parseAttribute):
(WebCore::HTMLAnchorElement::isSystemPreviewLink const):
* html/HTMLButtonElement.cpp:
(WebCore::HTMLButtonElement::formControlType const):
* html/HTMLDetailsElement.cpp:
(WebCore::summarySlotName):
* html/HTMLElement.cpp:
(WebCore::toValidDirValue):
(WebCore::trueName):
(WebCore::falseName):
(WebCore::plaintextOnlyName):
(WebCore::HTMLElement::setAutocorrect):
* html/HTMLFieldSetElement.cpp:
(WebCore::HTMLFieldSetElement::formControlType const):
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::autocomplete const):
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::loadingForBindings const):
* html/HTMLKeygenElement.cpp:
(WebCore::HTMLKeygenElement::formControlType const):
* html/HTMLOptGroupElement.cpp:
(WebCore::HTMLOptGroupElement::formControlType const):
* html/HTMLOutputElement.cpp:
(WebCore::HTMLOutputElement::formControlType const):
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::partOfSnapshotOverlay const):
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::formControlType const):
* html/HTMLTableCellElement.cpp:
(WebCore::HTMLTableCellElement::scope const):
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::formControlType const):
* html/HTMLTextFormControlElement.cpp:
(WebCore::directionString):
(WebCore::HTMLTextFormControlElement::updateInnerTextElementEditability):
* html/InputMode.cpp:
(WebCore::InputModeNames::none):
(WebCore::InputModeNames::text):
(WebCore::InputModeNames::tel):
(WebCore::InputModeNames::url):
(WebCore::InputModeNames::email):
(WebCore::InputModeNames::numeric):
(WebCore::InputModeNames::decimal):
(WebCore::InputModeNames::search):
* html/InputTypeNames.cpp:
(WebCore::InputTypeNames::button):
(WebCore::InputTypeNames::checkbox):
(WebCore::InputTypeNames::color):
(WebCore::InputTypeNames::date):
(WebCore::InputTypeNames::datetime):
(WebCore::InputTypeNames::datetimelocal):
(WebCore::InputTypeNames::email):
(WebCore::InputTypeNames::file):
(WebCore::InputTypeNames::hidden):
(WebCore::InputTypeNames::image):
(WebCore::InputTypeNames::month):
(WebCore::InputTypeNames::number):
(WebCore::InputTypeNames::password):
(WebCore::InputTypeNames::radio):
(WebCore::InputTypeNames::range):
(WebCore::InputTypeNames::reset):
(WebCore::InputTypeNames::search):
(WebCore::InputTypeNames::submit):
(WebCore::InputTypeNames::telephone):
(WebCore::InputTypeNames::text):
(WebCore::InputTypeNames::time):
(WebCore::InputTypeNames::url):
(WebCore::InputTypeNames::week):
* html/MediaController.cpp:
(WebCore::playbackStateWaiting):
(WebCore::playbackStatePlaying):
(WebCore::playbackStateEnded):
* html/RangeInputType.cpp:
(WebCore::RangeInputType::createShadowSubtree):
* html/SearchInputType.cpp:
(WebCore::updateResultButtonPseudoType):
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::createShadowSubtree):
(WebCore::TextFieldInputType::createDataListDropdownIndicator):
(WebCore::TextFieldInputType::createContainer):
(WebCore::TextFieldInputType::createAutoFillButton):
* html/ValidationMessage.cpp:
(WebCore::ValidationMessage::buildBubbleTree):
* html/shadow/DetailsMarkerControl.cpp:
(WebCore::DetailsMarkerControl::DetailsMarkerControl):
* html/shadow/MediaControlTextTrackContainerElement.cpp:
(WebCore::MediaControlTextTrackContainerElement::MediaControlTextTrackContainerElement):
* html/shadow/ProgressShadowElement.cpp:
(WebCore::ProgressInnerElement::create):
(WebCore::ProgressBarElement::create):
(WebCore::ProgressValueElement::create):
* html/shadow/SliderThumbElement.cpp:
(WebCore::SliderThumbElement::resolveCustomStyle):
(WebCore::SliderContainerElement::resolveCustomStyle):
* html/shadow/SpinButtonElement.cpp:
(WebCore::SpinButtonElement::SpinButtonElement):
* html/shadow/TextControlInnerElements.cpp:
(WebCore::TextControlPlaceholderElement::TextControlPlaceholderElement):
(WebCore::SearchFieldCancelButtonElement::SearchFieldCancelButtonElement):
* html/shadow/YouTubeEmbedShadowElement.cpp:
(WebCore::YouTubeEmbedShadowElement::YouTubeEmbedShadowElement):
* html/shadow/mac/ImageControlsButtonElementMac.cpp:
(WebCore::ImageControlsButtonElementMac::tryCreate):
* html/shadow/mac/ImageControlsRootElementMac.cpp:
(WebCore::ImageControlsRootElement::tryCreate):
* html/track/AudioTrack.cpp:
(WebCore::AudioTrack::alternativeKeyword):
(WebCore::AudioTrack::descriptionKeyword):
(WebCore::AudioTrack::mainKeyword):
(WebCore::AudioTrack::mainDescKeyword):
(WebCore::AudioTrack::translationKeyword):
(WebCore::AudioTrack::commentaryKeyword):
* html/track/TextTrack.cpp:
(WebCore::TextTrack::subtitlesKeyword):
(WebCore::captionsKeyword):
(WebCore::descriptionsKeyword):
(WebCore::chaptersKeyword):
(WebCore::metadataKeyword):
(WebCore::forcedKeyword):
* html/track/TextTrackCue.cpp:
(WebCore::TextTrackCue::cueShadowPseudoId):
(WebCore::TextTrackCue::cueBoxShadowPseudoId):
(WebCore::TextTrackCue::cueBackdropShadowPseudoId):
(WebCore::TextTrackCue::rebuildDisplayTree):
* html/track/VTTRegion.cpp:
(WebCore::upKeyword):
(WebCore::VTTRegion::textTrackCueContainerScrollingClass):
(WebCore::VTTRegion::textTrackCueContainerShadowPseudoId):
(WebCore::VTTRegion::textTrackRegionShadowPseudoId):
* html/track/VideoTrack.cpp:
(WebCore::VideoTrack::alternativeKeyword):
(WebCore::VideoTrack::captionsKeyword):
(WebCore::VideoTrack::mainKeyword):
(WebCore::VideoTrack::signKeyword):
(WebCore::VideoTrack::subtitlesKeyword):
(WebCore::VideoTrack::commentaryKeyword):
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::initiatorName const):
* page/EventHandler.cpp:
(WebCore::focusDirectionForKey):
* page/Quirks.cpp:
(WebCore::Quirks::shouldBypassBackForwardCache const):
* page/animation/CompositeAnimation.cpp:
(WebCore::CompositeAnimation::updateKeyframeAnimations):
* platform/cocoa/PlaybackSessionModelMediaElement.mm:
(WebCore::PlaybackSessionModelMediaElement::eventNameAll):
* platform/cocoa/VideoFullscreenModelVideoElement.mm:
(WebCore::VideoFullscreenModelVideoElement::eventNameAll):
* platform/graphics/FontCache.cpp:
(WebCore::FontCache::alternateFamilyName):
* platform/graphics/MediaPlayer.cpp:
(WebCore::applicationOctetStream):
(WebCore::textPlain):
* platform/graphics/avfoundation/CDMFairPlayStreaming.cpp:
(WebCore::CDMPrivateFairPlayStreaming::sinfName):
(WebCore::CDMPrivateFairPlayStreaming::skdName):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::metadataType):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::FontCache::similarFont):
(WebCore::FontCache::platformAlternateFamilyName):
* platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
(WebCore::SystemFontDatabaseCoreText::systemFontParameters):
* platform/graphics/filters/SourceAlpha.cpp:
(WebCore::SourceAlpha::effectName):
* platform/graphics/filters/SourceGraphic.cpp:
(WebCore::SourceGraphic::effectName):
* platform/graphics/ios/FontCacheIOS.mm:
(WebCore::FontCache::getCustomFallbackFont):
* platform/graphics/texmap/TextureMapperShaderProgram.h:
* platform/graphics/win/FontCacheWin.cpp:
(WebCore::FontCache::lastResortFallbackFont):
(WebCore::FontCache::platformAlternateFamilyName):
* platform/network/cocoa/ResourceResponseCocoa.mm:
(WebCore::extractHTTPStatusText):
* rendering/ComplexLineLayout.cpp:
(WebCore::ComplexLineLayout::checkLinesForTextOverflow):
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::hyphenString const):
(WebCore::RenderStyle::textEmphasisMarkString const):
* style/StyleAdjuster.cpp:
(WebCore::Style::Adjuster::adjustForSiteSpecificQuirks const):
* svg/SVGAnimateMotionElement.cpp:
(WebCore::SVGAnimateMotionElement::rotateMode const):
* svg/SVGAnimationElement.cpp:
(WebCore::SVGAnimationElement::setCalcMode):
(WebCore::SVGAnimationElement::setAttributeType):
(WebCore::SVGAnimationElement::isAdditive const):
(WebCore::SVGAnimationElement::isAccumulated const):
(WebCore::inheritsFromProperty):
* svg/SVGStyleElement.cpp:
(WebCore::SVGStyleElement::type const):
(WebCore::SVGStyleElement::media const):
* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::parseClockValue):
(WebCore::SVGSMILElement::restart const):
(WebCore::SVGSMILElement::fill const):
(WebCore::SVGSMILElement::repeatCount const):
* svg/properties/SVGAnimationAdditiveValueFunctionImpl.cpp:
(WebCore::SVGAnimationColorFunction::colorFromString):
* svg/properties/SVGPropertyAnimator.h:
(WebCore::SVGPropertyAnimator::adjustForInheritance const):

Source/WTF:

Since AtomString has thread-affinity, `static NeverDestroyed<const AtomString>` is basically only safe for the main-thread use.
We should ensure that this is only used in the main-thread. To do that, this patch introduces MainThreadNeverDestroyed and
MainThreadLazyNeverDestroyed. They are NeverDestroyed and LazyNeverDestroyed + main-thread assertions.

* wtf/Forward.h:
* wtf/NeverDestroyed.h:
(WTF::AnyThreadsAccessTraits::assertAccess):
(WTF::MainThreadAccessTraits::assertAccess):
(WTF::NeverDestroyed::NeverDestroyed):
(WTF::NeverDestroyed::storagePointer const):
(WTF::LazyNeverDestroyed::construct):
(WTF::LazyNeverDestroyed::storagePointer const):
(WTF::makeNeverDestroyed):
* wtf/text/AtomString.cpp:
* wtf/text/AtomString.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@261013 268f45cc-cd09-0410-ab3c-d52691b4dbfc

88 files changed:
Source/WTF/ChangeLog
Source/WTF/wtf/Forward.h
Source/WTF/wtf/NeverDestroyed.h
Source/WTF/wtf/text/AtomString.cpp
Source/WTF/wtf/text/AtomString.h
Source/WebCore/ChangeLog
Source/WebCore/Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.cpp
Source/WebCore/Modules/encryptedmedia/InitDataRegistry.cpp
Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp
Source/WebCore/Modules/mediastream/MediaStreamTrack.cpp
Source/WebCore/Modules/mediastream/RTCDataChannel.cpp
Source/WebCore/accessibility/AccessibilityRenderObject.cpp
Source/WebCore/dom/ConstantPropertyMap.cpp
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/InlineStyleSheetOwner.cpp
Source/WebCore/dom/MutationRecord.cpp
Source/WebCore/dom/make_names.pl
Source/WebCore/html/Autocapitalize.cpp
Source/WebCore/html/Autofill.cpp
Source/WebCore/html/BaseCheckableInputType.cpp
Source/WebCore/html/BaseChooserOnlyDateAndTimeInputType.cpp
Source/WebCore/html/ColorInputType.cpp
Source/WebCore/html/FileInputType.cpp
Source/WebCore/html/FormController.cpp
Source/WebCore/html/HTMLAnchorElement.cpp
Source/WebCore/html/HTMLButtonElement.cpp
Source/WebCore/html/HTMLDetailsElement.cpp
Source/WebCore/html/HTMLElement.cpp
Source/WebCore/html/HTMLFieldSetElement.cpp
Source/WebCore/html/HTMLFormElement.cpp
Source/WebCore/html/HTMLImageElement.cpp
Source/WebCore/html/HTMLKeygenElement.cpp
Source/WebCore/html/HTMLOptGroupElement.cpp
Source/WebCore/html/HTMLOutputElement.cpp
Source/WebCore/html/HTMLPlugInImageElement.cpp
Source/WebCore/html/HTMLSelectElement.cpp
Source/WebCore/html/HTMLTableCellElement.cpp
Source/WebCore/html/HTMLTextAreaElement.cpp
Source/WebCore/html/HTMLTextFormControlElement.cpp
Source/WebCore/html/InputMode.cpp
Source/WebCore/html/InputTypeNames.cpp
Source/WebCore/html/MediaController.cpp
Source/WebCore/html/RangeInputType.cpp
Source/WebCore/html/SearchInputType.cpp
Source/WebCore/html/TextFieldInputType.cpp
Source/WebCore/html/ValidationMessage.cpp
Source/WebCore/html/shadow/DetailsMarkerControl.cpp
Source/WebCore/html/shadow/MediaControlTextTrackContainerElement.cpp
Source/WebCore/html/shadow/ProgressShadowElement.cpp
Source/WebCore/html/shadow/SliderThumbElement.cpp
Source/WebCore/html/shadow/SpinButtonElement.cpp
Source/WebCore/html/shadow/TextControlInnerElements.cpp
Source/WebCore/html/shadow/YouTubeEmbedShadowElement.cpp
Source/WebCore/html/shadow/mac/ImageControlsButtonElementMac.cpp
Source/WebCore/html/shadow/mac/ImageControlsRootElementMac.cpp
Source/WebCore/html/track/AudioTrack.cpp
Source/WebCore/html/track/TextTrack.cpp
Source/WebCore/html/track/TextTrackCue.cpp
Source/WebCore/html/track/VTTRegion.cpp
Source/WebCore/html/track/VideoTrack.cpp
Source/WebCore/loader/cache/CachedResourceRequest.cpp
Source/WebCore/page/EventHandler.cpp
Source/WebCore/page/Quirks.cpp
Source/WebCore/page/animation/CompositeAnimation.cpp
Source/WebCore/platform/cocoa/PlaybackSessionModelMediaElement.mm
Source/WebCore/platform/cocoa/VideoFullscreenModelVideoElement.mm
Source/WebCore/platform/graphics/FontCache.cpp
Source/WebCore/platform/graphics/MediaPlayer.cpp
Source/WebCore/platform/graphics/avfoundation/CDMFairPlayStreaming.cpp
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm
Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp
Source/WebCore/platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp
Source/WebCore/platform/graphics/filters/SourceAlpha.cpp
Source/WebCore/platform/graphics/filters/SourceGraphic.cpp
Source/WebCore/platform/graphics/ios/FontCacheIOS.mm
Source/WebCore/platform/graphics/texmap/TextureMapperShaderProgram.h
Source/WebCore/platform/graphics/win/FontCacheWin.cpp
Source/WebCore/platform/network/cocoa/ResourceResponseCocoa.mm
Source/WebCore/rendering/ComplexLineLayout.cpp
Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp
Source/WebCore/rendering/style/RenderStyle.cpp
Source/WebCore/style/StyleAdjuster.cpp
Source/WebCore/svg/SVGAnimateMotionElement.cpp
Source/WebCore/svg/SVGAnimationElement.cpp
Source/WebCore/svg/SVGStyleElement.cpp
Source/WebCore/svg/animation/SVGSMILElement.cpp
Source/WebCore/svg/properties/SVGAnimationAdditiveValueFunctionImpl.cpp
Source/WebCore/svg/properties/SVGPropertyAnimator.h

index 9e9b336..b621275 100644 (file)
@@ -1,3 +1,26 @@
+2020-05-01  Yusuke Suzuki  <ysuzuki@apple.com>
+
+        Introduce MainThreadNeverDestroyed / MainThreadLazyNeverDestroyed
+        https://bugs.webkit.org/show_bug.cgi?id=211264
+
+        Reviewed by Mark Lam.
+
+        Since AtomString has thread-affinity, `static NeverDestroyed<const AtomString>` is basically only safe for the main-thread use.
+        We should ensure that this is only used in the main-thread. To do that, this patch introduces MainThreadNeverDestroyed and
+        MainThreadLazyNeverDestroyed. They are NeverDestroyed and LazyNeverDestroyed + main-thread assertions.
+
+        * wtf/Forward.h:
+        * wtf/NeverDestroyed.h:
+        (WTF::AnyThreadsAccessTraits::assertAccess):
+        (WTF::MainThreadAccessTraits::assertAccess):
+        (WTF::NeverDestroyed::NeverDestroyed):
+        (WTF::NeverDestroyed::storagePointer const):
+        (WTF::LazyNeverDestroyed::construct):
+        (WTF::LazyNeverDestroyed::storagePointer const):
+        (WTF::makeNeverDestroyed):
+        * wtf/text/AtomString.cpp:
+        * wtf/text/AtomString.h:
+
 2020-05-01  Don Olmstead  <don.olmstead@sony.com>
 
         Use export macros on all platforms
index 6e97d5d..f76ca43 100644 (file)
@@ -54,12 +54,14 @@ struct VectorMalloc;
 using VectorMalloc = FastMalloc;
 #endif
 
+struct AnyThreadsAccessTraits;
+struct MainThreadAccessTraits;
 template<typename> class CompletionHandler;
 template<typename T> struct DumbPtrTraits;
 template<typename T> struct DumbValueTraits;
 template<typename> class Function;
-template<typename> class LazyNeverDestroyed;
-template<typename> class NeverDestroyed;
+template<typename, typename = AnyThreadsAccessTraits> class LazyNeverDestroyed;
+template<typename, typename = AnyThreadsAccessTraits> class NeverDestroyed;
 template<typename> class OptionSet;
 template<typename> class Optional;
 template<typename T> class Packed;
index b9c915a..d8242fe 100644 (file)
@@ -28,6 +28,7 @@
 #include <type_traits>
 #include <utility>
 #include <wtf/ForbidHeapAllocation.h>
+#include <wtf/MainThread.h>
 #include <wtf/RefCounted.h>
 
 // NeverDestroyed is a smart-pointer-like class that ensures that the destructor
 
 namespace WTF {
 
-template<typename T> class NeverDestroyed {
+struct AnyThreadsAccessTraits {
+    static void assertAccess()
+    {
+    }
+};
+
+struct MainThreadAccessTraits {
+    static void assertAccess()
+    {
+        ASSERT(isMainThread());
+    }
+};
+
+template<typename T, typename AccessTraits> class NeverDestroyed {
     WTF_MAKE_NONCOPYABLE(NeverDestroyed);
     WTF_FORBID_HEAP_ALLOCATION;
 public:
 
     template<typename... Args> NeverDestroyed(Args&&... args)
     {
+        AccessTraits::assertAccess();
         MaybeRelax<T>(new (storagePointer()) T(std::forward<Args>(args)...));
     }
 
     NeverDestroyed(NeverDestroyed&& other)
     {
+        AccessTraits::assertAccess();
         MaybeRelax<T>(new (storagePointer()) T(WTFMove(*other.storagePointer())));
     }
 
@@ -70,7 +86,11 @@ public:
 private:
     using PointerType = typename std::remove_const<T>::type*;
 
-    PointerType storagePointer() const { return const_cast<PointerType>(reinterpret_cast<const T*>(&m_storage)); }
+    PointerType storagePointer() const
+    {
+        AccessTraits::assertAccess();
+        return const_cast<PointerType>(reinterpret_cast<const T*>(&m_storage));
+    }
 
     template<typename PtrType, bool ShouldRelax = std::is_base_of<RefCountedBase, PtrType>::value> struct MaybeRelax {
         explicit MaybeRelax(PtrType*) { }
@@ -84,12 +104,12 @@ private:
     typename std::aligned_storage<sizeof(T), std::alignment_of<T>::value>::type m_storage;
 };
 
-template<typename T> NeverDestroyed<T> makeNeverDestroyed(T&&);
+template<typename T, typename AccessTraits = AnyThreadsAccessTraits> NeverDestroyed<T, AccessTraits> makeNeverDestroyed(T&&);
 
 // FIXME: It's messy to have to repeat the whole class just to make this "lazy" version.
 // Should revisit clients to see if we really need this, and perhaps use templates to
 // share more of the code with the main NeverDestroyed above.
-template<typename T> class LazyNeverDestroyed {
+template<typename T, typename AccessTraits> class LazyNeverDestroyed {
     WTF_MAKE_NONCOPYABLE(LazyNeverDestroyed);
     WTF_FORBID_HEAP_ALLOCATION;
 public:
@@ -99,6 +119,7 @@ public:
     void construct(Args&&... args)
     {
         ASSERT(!m_isConstructed);
+        AccessTraits::assertAccess();
 
 #if ASSERT_ENABLED
         m_isConstructed = true;
@@ -127,6 +148,7 @@ private:
     PointerType storagePointer() const
     {
         ASSERT(m_isConstructed);
+        AccessTraits::assertAccess();
         return const_cast<PointerType>(reinterpret_cast<const T*>(&m_storage));
     }
 
@@ -148,13 +170,23 @@ private:
     typename std::aligned_storage<sizeof(T), std::alignment_of<T>::value>::type m_storage;
 };
 
-template<typename T> inline NeverDestroyed<T> makeNeverDestroyed(T&& argument)
+template<typename T, typename AccessTraits> inline NeverDestroyed<T, AccessTraits> makeNeverDestroyed(T&& argument)
 {
     return WTFMove(argument);
 }
 
+template<typename T>
+using MainThreadNeverDestroyed = NeverDestroyed<T, MainThreadAccessTraits>;
+
+template<typename T>
+using MainThreadLazyNeverDestroyed = LazyNeverDestroyed<T, MainThreadAccessTraits>;
+
 } // namespace WTF;
 
 using WTF::LazyNeverDestroyed;
 using WTF::NeverDestroyed;
 using WTF::makeNeverDestroyed;
+using WTF::MainThreadNeverDestroyed;
+using WTF::MainThreadLazyNeverDestroyed;
+using WTF::AnyThreadsAccessTraits;
+using WTF::MainThreadAccessTraits;
index 7068f5f..339bae3 100644 (file)
@@ -133,11 +133,11 @@ void AtomString::show() const
 
 #endif
 
-WTF_EXPORT_PRIVATE LazyNeverDestroyed<AtomString> nullAtomData;
-WTF_EXPORT_PRIVATE LazyNeverDestroyed<AtomString> emptyAtomData;
-WTF_EXPORT_PRIVATE LazyNeverDestroyed<AtomString> starAtomData;
-WTF_EXPORT_PRIVATE LazyNeverDestroyed<AtomString> xmlAtomData;
-WTF_EXPORT_PRIVATE LazyNeverDestroyed<AtomString> xmlnsAtomData;
+WTF_EXPORT_PRIVATE LazyNeverDestroyed<const AtomString> nullAtomData;
+WTF_EXPORT_PRIVATE LazyNeverDestroyed<const AtomString> emptyAtomData;
+WTF_EXPORT_PRIVATE MainThreadLazyNeverDestroyed<const AtomString> starAtomData;
+WTF_EXPORT_PRIVATE MainThreadLazyNeverDestroyed<const AtomString> xmlAtomData;
+WTF_EXPORT_PRIVATE MainThreadLazyNeverDestroyed<const AtomString> xmlnsAtomData;
 
 void AtomString::init()
 {
index 88b4eba..223df6a 100644 (file)
@@ -288,13 +288,15 @@ inline AtomString::AtomString(NSString *string)
 
 #endif
 
+// nullAtom and emptyAtom are special AtomString. They can be used from any threads since their StringImpls are not actually registered into AtomStringTable.
+extern WTF_EXPORT_PRIVATE LazyNeverDestroyed<const AtomString> nullAtomData;
+extern WTF_EXPORT_PRIVATE LazyNeverDestroyed<const AtomString> emptyAtomData;
+
 // Define external global variables for the commonly used atom strings.
 // These are only usable from the main thread.
-extern WTF_EXPORT_PRIVATE LazyNeverDestroyed<AtomString> nullAtomData;
-extern WTF_EXPORT_PRIVATE LazyNeverDestroyed<AtomString> emptyAtomData;
-extern WTF_EXPORT_PRIVATE LazyNeverDestroyed<AtomString> starAtomData;
-extern WTF_EXPORT_PRIVATE LazyNeverDestroyed<AtomString> xmlAtomData;
-extern WTF_EXPORT_PRIVATE LazyNeverDestroyed<AtomString> xmlnsAtomData;
+extern WTF_EXPORT_PRIVATE MainThreadLazyNeverDestroyed<const AtomString> starAtomData;
+extern WTF_EXPORT_PRIVATE MainThreadLazyNeverDestroyed<const AtomString> xmlAtomData;
+extern WTF_EXPORT_PRIVATE MainThreadLazyNeverDestroyed<const AtomString> xmlnsAtomData;
 
 inline const AtomString& nullAtom() { return nullAtomData.get(); }
 inline const AtomString& emptyAtom() { return emptyAtomData.get(); }
index 953364b..25e805a 100644 (file)
@@ -1,3 +1,262 @@
+2020-05-01  Yusuke Suzuki  <ysuzuki@apple.com>
+
+        Introduce MainThreadNeverDestroyed / MainThreadLazyNeverDestroyed
+        https://bugs.webkit.org/show_bug.cgi?id=211264
+
+        Reviewed by Mark Lam.
+
+        No behavior change. Adding assertions additionally.
+
+        * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.cpp:
+        (WebCore::stringForPlaybackTargetAvailability):
+        * Modules/encryptedmedia/InitDataRegistry.cpp:
+        (WebCore::InitDataRegistry::cencName):
+        (WebCore::InitDataRegistry::keyidsName):
+        (WebCore::InitDataRegistry::webmName):
+        * Modules/mediacontrols/MediaControlsHost.cpp:
+        (WebCore::MediaControlsHost::automaticKeyword):
+        (WebCore::MediaControlsHost::forcedOnlyKeyword):
+        (WebCore::alwaysOnKeyword):
+        (WebCore::manualKeyword):
+        * Modules/mediastream/MediaStreamTrack.cpp:
+        (WebCore::MediaStreamTrack::kind const):
+        (WebCore::MediaStreamTrack::contentHint const):
+        * Modules/mediastream/RTCDataChannel.cpp:
+        (WebCore::blobKeyword):
+        (WebCore::arraybufferKeyword):
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::liveRegionRelevant const):
+        * dom/ConstantPropertyMap.cpp:
+        (WebCore::ConstantPropertyMap::nameForProperty const):
+        * dom/Document.cpp:
+        (WebCore::Document::validateCustomElementName):
+        * dom/InlineStyleSheetOwner.cpp:
+        (WebCore::isValidCSSContentType):
+        * dom/MutationRecord.cpp:
+        * dom/make_names.pl:
+        (printNamesHeaderFile):
+        (printNamesCppFile):
+        * html/Autocapitalize.cpp:
+        (WebCore::stringForAutocapitalizeType):
+        * html/Autofill.cpp:
+        (WebCore::isContactToken):
+        (WebCore::AutofillData::createFromHTMLFormControlElement):
+        * html/BaseCheckableInputType.cpp:
+        (WebCore::BaseCheckableInputType::fallbackValue const):
+        * html/BaseChooserOnlyDateAndTimeInputType.cpp:
+        (WebCore::BaseChooserOnlyDateAndTimeInputType::createShadowSubtree):
+        * html/ColorInputType.cpp:
+        (WebCore::ColorInputType::createShadowSubtree):
+        * html/FileInputType.cpp:
+        (WebCore::UploadButtonElement::UploadButtonElement):
+        * html/FormController.cpp:
+        (WebCore::FormKeyGenerator::formKey):
+        * html/HTMLAnchorElement.cpp:
+        (WebCore::HTMLAnchorElement::parseAttribute):
+        (WebCore::HTMLAnchorElement::isSystemPreviewLink const):
+        * html/HTMLButtonElement.cpp:
+        (WebCore::HTMLButtonElement::formControlType const):
+        * html/HTMLDetailsElement.cpp:
+        (WebCore::summarySlotName):
+        * html/HTMLElement.cpp:
+        (WebCore::toValidDirValue):
+        (WebCore::trueName):
+        (WebCore::falseName):
+        (WebCore::plaintextOnlyName):
+        (WebCore::HTMLElement::setAutocorrect):
+        * html/HTMLFieldSetElement.cpp:
+        (WebCore::HTMLFieldSetElement::formControlType const):
+        * html/HTMLFormElement.cpp:
+        (WebCore::HTMLFormElement::autocomplete const):
+        * html/HTMLImageElement.cpp:
+        (WebCore::HTMLImageElement::loadingForBindings const):
+        * html/HTMLKeygenElement.cpp:
+        (WebCore::HTMLKeygenElement::formControlType const):
+        * html/HTMLOptGroupElement.cpp:
+        (WebCore::HTMLOptGroupElement::formControlType const):
+        * html/HTMLOutputElement.cpp:
+        (WebCore::HTMLOutputElement::formControlType const):
+        * html/HTMLPlugInImageElement.cpp:
+        (WebCore::HTMLPlugInImageElement::partOfSnapshotOverlay const):
+        * html/HTMLSelectElement.cpp:
+        (WebCore::HTMLSelectElement::formControlType const):
+        * html/HTMLTableCellElement.cpp:
+        (WebCore::HTMLTableCellElement::scope const):
+        * html/HTMLTextAreaElement.cpp:
+        (WebCore::HTMLTextAreaElement::formControlType const):
+        * html/HTMLTextFormControlElement.cpp:
+        (WebCore::directionString):
+        (WebCore::HTMLTextFormControlElement::updateInnerTextElementEditability):
+        * html/InputMode.cpp:
+        (WebCore::InputModeNames::none):
+        (WebCore::InputModeNames::text):
+        (WebCore::InputModeNames::tel):
+        (WebCore::InputModeNames::url):
+        (WebCore::InputModeNames::email):
+        (WebCore::InputModeNames::numeric):
+        (WebCore::InputModeNames::decimal):
+        (WebCore::InputModeNames::search):
+        * html/InputTypeNames.cpp:
+        (WebCore::InputTypeNames::button):
+        (WebCore::InputTypeNames::checkbox):
+        (WebCore::InputTypeNames::color):
+        (WebCore::InputTypeNames::date):
+        (WebCore::InputTypeNames::datetime):
+        (WebCore::InputTypeNames::datetimelocal):
+        (WebCore::InputTypeNames::email):
+        (WebCore::InputTypeNames::file):
+        (WebCore::InputTypeNames::hidden):
+        (WebCore::InputTypeNames::image):
+        (WebCore::InputTypeNames::month):
+        (WebCore::InputTypeNames::number):
+        (WebCore::InputTypeNames::password):
+        (WebCore::InputTypeNames::radio):
+        (WebCore::InputTypeNames::range):
+        (WebCore::InputTypeNames::reset):
+        (WebCore::InputTypeNames::search):
+        (WebCore::InputTypeNames::submit):
+        (WebCore::InputTypeNames::telephone):
+        (WebCore::InputTypeNames::text):
+        (WebCore::InputTypeNames::time):
+        (WebCore::InputTypeNames::url):
+        (WebCore::InputTypeNames::week):
+        * html/MediaController.cpp:
+        (WebCore::playbackStateWaiting):
+        (WebCore::playbackStatePlaying):
+        (WebCore::playbackStateEnded):
+        * html/RangeInputType.cpp:
+        (WebCore::RangeInputType::createShadowSubtree):
+        * html/SearchInputType.cpp:
+        (WebCore::updateResultButtonPseudoType):
+        * html/TextFieldInputType.cpp:
+        (WebCore::TextFieldInputType::createShadowSubtree):
+        (WebCore::TextFieldInputType::createDataListDropdownIndicator):
+        (WebCore::TextFieldInputType::createContainer):
+        (WebCore::TextFieldInputType::createAutoFillButton):
+        * html/ValidationMessage.cpp:
+        (WebCore::ValidationMessage::buildBubbleTree):
+        * html/shadow/DetailsMarkerControl.cpp:
+        (WebCore::DetailsMarkerControl::DetailsMarkerControl):
+        * html/shadow/MediaControlTextTrackContainerElement.cpp:
+        (WebCore::MediaControlTextTrackContainerElement::MediaControlTextTrackContainerElement):
+        * html/shadow/ProgressShadowElement.cpp:
+        (WebCore::ProgressInnerElement::create):
+        (WebCore::ProgressBarElement::create):
+        (WebCore::ProgressValueElement::create):
+        * html/shadow/SliderThumbElement.cpp:
+        (WebCore::SliderThumbElement::resolveCustomStyle):
+        (WebCore::SliderContainerElement::resolveCustomStyle):
+        * html/shadow/SpinButtonElement.cpp:
+        (WebCore::SpinButtonElement::SpinButtonElement):
+        * html/shadow/TextControlInnerElements.cpp:
+        (WebCore::TextControlPlaceholderElement::TextControlPlaceholderElement):
+        (WebCore::SearchFieldCancelButtonElement::SearchFieldCancelButtonElement):
+        * html/shadow/YouTubeEmbedShadowElement.cpp:
+        (WebCore::YouTubeEmbedShadowElement::YouTubeEmbedShadowElement):
+        * html/shadow/mac/ImageControlsButtonElementMac.cpp:
+        (WebCore::ImageControlsButtonElementMac::tryCreate):
+        * html/shadow/mac/ImageControlsRootElementMac.cpp:
+        (WebCore::ImageControlsRootElement::tryCreate):
+        * html/track/AudioTrack.cpp:
+        (WebCore::AudioTrack::alternativeKeyword):
+        (WebCore::AudioTrack::descriptionKeyword):
+        (WebCore::AudioTrack::mainKeyword):
+        (WebCore::AudioTrack::mainDescKeyword):
+        (WebCore::AudioTrack::translationKeyword):
+        (WebCore::AudioTrack::commentaryKeyword):
+        * html/track/TextTrack.cpp:
+        (WebCore::TextTrack::subtitlesKeyword):
+        (WebCore::captionsKeyword):
+        (WebCore::descriptionsKeyword):
+        (WebCore::chaptersKeyword):
+        (WebCore::metadataKeyword):
+        (WebCore::forcedKeyword):
+        * html/track/TextTrackCue.cpp:
+        (WebCore::TextTrackCue::cueShadowPseudoId):
+        (WebCore::TextTrackCue::cueBoxShadowPseudoId):
+        (WebCore::TextTrackCue::cueBackdropShadowPseudoId):
+        (WebCore::TextTrackCue::rebuildDisplayTree):
+        * html/track/VTTRegion.cpp:
+        (WebCore::upKeyword):
+        (WebCore::VTTRegion::textTrackCueContainerScrollingClass):
+        (WebCore::VTTRegion::textTrackCueContainerShadowPseudoId):
+        (WebCore::VTTRegion::textTrackRegionShadowPseudoId):
+        * html/track/VideoTrack.cpp:
+        (WebCore::VideoTrack::alternativeKeyword):
+        (WebCore::VideoTrack::captionsKeyword):
+        (WebCore::VideoTrack::mainKeyword):
+        (WebCore::VideoTrack::signKeyword):
+        (WebCore::VideoTrack::subtitlesKeyword):
+        (WebCore::VideoTrack::commentaryKeyword):
+        * loader/cache/CachedResourceRequest.cpp:
+        (WebCore::CachedResourceRequest::initiatorName const):
+        * page/EventHandler.cpp:
+        (WebCore::focusDirectionForKey):
+        * page/Quirks.cpp:
+        (WebCore::Quirks::shouldBypassBackForwardCache const):
+        * page/animation/CompositeAnimation.cpp:
+        (WebCore::CompositeAnimation::updateKeyframeAnimations):
+        * platform/cocoa/PlaybackSessionModelMediaElement.mm:
+        (WebCore::PlaybackSessionModelMediaElement::eventNameAll):
+        * platform/cocoa/VideoFullscreenModelVideoElement.mm:
+        (WebCore::VideoFullscreenModelVideoElement::eventNameAll):
+        * platform/graphics/FontCache.cpp:
+        (WebCore::FontCache::alternateFamilyName):
+        * platform/graphics/MediaPlayer.cpp:
+        (WebCore::applicationOctetStream):
+        (WebCore::textPlain):
+        * platform/graphics/avfoundation/CDMFairPlayStreaming.cpp:
+        (WebCore::CDMPrivateFairPlayStreaming::sinfName):
+        (WebCore::CDMPrivateFairPlayStreaming::skdName):
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+        (WebCore::metadataType):
+        * platform/graphics/cocoa/FontCacheCoreText.cpp:
+        (WebCore::FontCache::similarFont):
+        (WebCore::FontCache::platformAlternateFamilyName):
+        * platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
+        (WebCore::SystemFontDatabaseCoreText::systemFontParameters):
+        * platform/graphics/filters/SourceAlpha.cpp:
+        (WebCore::SourceAlpha::effectName):
+        * platform/graphics/filters/SourceGraphic.cpp:
+        (WebCore::SourceGraphic::effectName):
+        * platform/graphics/ios/FontCacheIOS.mm:
+        (WebCore::FontCache::getCustomFallbackFont):
+        * platform/graphics/texmap/TextureMapperShaderProgram.h:
+        * platform/graphics/win/FontCacheWin.cpp:
+        (WebCore::FontCache::lastResortFallbackFont):
+        (WebCore::FontCache::platformAlternateFamilyName):
+        * platform/network/cocoa/ResourceResponseCocoa.mm:
+        (WebCore::extractHTTPStatusText):
+        * rendering/ComplexLineLayout.cpp:
+        (WebCore::ComplexLineLayout::checkLinesForTextOverflow):
+        * rendering/RenderDeprecatedFlexibleBox.cpp:
+        (WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
+        * rendering/style/RenderStyle.cpp:
+        (WebCore::RenderStyle::hyphenString const):
+        (WebCore::RenderStyle::textEmphasisMarkString const):
+        * style/StyleAdjuster.cpp:
+        (WebCore::Style::Adjuster::adjustForSiteSpecificQuirks const):
+        * svg/SVGAnimateMotionElement.cpp:
+        (WebCore::SVGAnimateMotionElement::rotateMode const):
+        * svg/SVGAnimationElement.cpp:
+        (WebCore::SVGAnimationElement::setCalcMode):
+        (WebCore::SVGAnimationElement::setAttributeType):
+        (WebCore::SVGAnimationElement::isAdditive const):
+        (WebCore::SVGAnimationElement::isAccumulated const):
+        (WebCore::inheritsFromProperty):
+        * svg/SVGStyleElement.cpp:
+        (WebCore::SVGStyleElement::type const):
+        (WebCore::SVGStyleElement::media const):
+        * svg/animation/SVGSMILElement.cpp:
+        (WebCore::SVGSMILElement::parseClockValue):
+        (WebCore::SVGSMILElement::restart const):
+        (WebCore::SVGSMILElement::fill const):
+        (WebCore::SVGSMILElement::repeatCount const):
+        * svg/properties/SVGAnimationAdditiveValueFunctionImpl.cpp:
+        (WebCore::SVGAnimationColorFunction::colorFromString):
+        * svg/properties/SVGPropertyAnimator.h:
+        (WebCore::SVGPropertyAnimator::adjustForInheritance const):
+
 2020-05-01  Chris Dumez  <cdumez@apple.com>
 
         REGRESSION (r260243): [ Mac WK1 ] fast/media/mq-inverted-colors-live-update-for-listener.html is a flaky failure
index 5c84c85..b9b66a2 100644 (file)
@@ -37,8 +37,8 @@ WTF_MAKE_ISO_ALLOCATED_IMPL(WebKitPlaybackTargetAvailabilityEvent);
 
 static const AtomString& stringForPlaybackTargetAvailability(bool available)
 {
-    static NeverDestroyed<AtomString> availableString("available", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<AtomString> notAvailableString("not-available", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> availableString("available", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> notAvailableString("not-available", AtomString::ConstructFromLiteral);
 
     return available ? availableString : notAvailableString;
 }
index 7c546dc..3b25d06 100644 (file)
@@ -258,19 +258,19 @@ void InitDataRegistry::registerInitDataType(const AtomString& initDataType, Init
 
 const AtomString& InitDataRegistry::cencName()
 {
-    static NeverDestroyed<AtomString> sinf { MAKE_STATIC_STRING_IMPL("cenc") };
+    static MainThreadNeverDestroyed<const AtomString> sinf { MAKE_STATIC_STRING_IMPL("cenc") };
     return sinf;
 }
 
 const AtomString& InitDataRegistry::keyidsName()
 {
-    static NeverDestroyed<AtomString> sinf { MAKE_STATIC_STRING_IMPL("keyids") };
+    static MainThreadNeverDestroyed<const AtomString> sinf { MAKE_STATIC_STRING_IMPL("keyids") };
     return sinf;
 }
 
 const AtomString& InitDataRegistry::webmName()
 {
-    static NeverDestroyed<AtomString> sinf { MAKE_STATIC_STRING_IMPL("webm") };
+    static MainThreadNeverDestroyed<const AtomString> sinf { MAKE_STATIC_STRING_IMPL("webm") };
     return sinf;
 }
 
index 60ea6e7..f981ecc 100644 (file)
@@ -43,25 +43,25 @@ namespace WebCore {
 
 const AtomString& MediaControlsHost::automaticKeyword()
 {
-    static NeverDestroyed<const AtomString> automatic("automatic", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> automatic("automatic", AtomString::ConstructFromLiteral);
     return automatic;
 }
 
 const AtomString& MediaControlsHost::forcedOnlyKeyword()
 {
-    static NeverDestroyed<const AtomString> forcedOnly("forced-only", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> forcedOnly("forced-only", AtomString::ConstructFromLiteral);
     return forcedOnly;
 }
 
 static const AtomString& alwaysOnKeyword()
 {
-    static NeverDestroyed<const AtomString> alwaysOn("always-on", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> alwaysOn("always-on", AtomString::ConstructFromLiteral);
     return alwaysOn;
 }
 
 static const AtomString& manualKeyword()
 {
-    static NeverDestroyed<const AtomString> alwaysOn("manual", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> alwaysOn("manual", AtomString::ConstructFromLiteral);
     return alwaysOn;
 }
 
index d0b2cb9..085e4fd 100644 (file)
@@ -109,8 +109,8 @@ MediaStreamTrack::~MediaStreamTrack()
 
 const AtomString& MediaStreamTrack::kind() const
 {
-    static NeverDestroyed<AtomString> audioKind("audio", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<AtomString> videoKind("video", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> audioKind("audio", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> videoKind("video", AtomString::ConstructFromLiteral);
 
     if (m_private->type() == RealtimeMediaSource::Type::Audio)
         return audioKind;
@@ -129,11 +129,11 @@ const String& MediaStreamTrack::label() const
 
 const AtomString& MediaStreamTrack::contentHint() const
 {
-    static NeverDestroyed<const AtomString> speechHint("speech", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<const AtomString> musicHint("music", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<const AtomString> detailHint("detail", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<const AtomString> textHint("text", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<const AtomString> motionHint("motion", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> speechHint("speech", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> musicHint("music", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> detailHint("detail", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> textHint("text", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> motionHint("motion", AtomString::ConstructFromLiteral);
 
     switch (m_private->contentHint()) {
     case MediaStreamTrackPrivate::HintValue::Empty:
index 6a0df04..0be312a 100644 (file)
@@ -43,13 +43,13 @@ WTF_MAKE_ISO_ALLOCATED_IMPL(RTCDataChannel);
 
 static const AtomString& blobKeyword()
 {
-    static NeverDestroyed<AtomString> blob("blob", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> blob("blob", AtomString::ConstructFromLiteral);
     return blob;
 }
 
 static const AtomString& arraybufferKeyword()
 {
-    static NeverDestroyed<AtomString> arraybuffer("arraybuffer", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> arraybuffer("arraybuffer", AtomString::ConstructFromLiteral);
     return arraybuffer;
 }
 
index 02c7570..262b29c 100644 (file)
@@ -3410,7 +3410,7 @@ const String AccessibilityRenderObject::liveRegionStatus() const
 
 const String AccessibilityRenderObject::liveRegionRelevant() const
 {
-    static NeverDestroyed<const AtomString> defaultLiveRegionRelevant("additions text", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> defaultLiveRegionRelevant("additions text", AtomString::ConstructFromLiteral);
     const AtomString& relevant = getAttribute(aria_relevantAttr);
 
     // Default aria-relevant = "additions text".
index fd142f7..be5ad48 100644 (file)
@@ -50,15 +50,15 @@ const ConstantPropertyMap::Values& ConstantPropertyMap::values() const
 
 const AtomString& ConstantPropertyMap::nameForProperty(ConstantProperty property) const
 {
-    static NeverDestroyed<AtomString> safeAreaInsetTopName("safe-area-inset-top", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<AtomString> safeAreaInsetRightName("safe-area-inset-right", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<AtomString> safeAreaInsetBottomName("safe-area-inset-bottom", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<AtomString> safeAreaInsetLeftName("safe-area-inset-left", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<AtomString> fullscreenInsetTopName("fullscreen-inset-top", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<AtomString> fullscreenInsetLeftName("fullscreen-inset-left", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<AtomString> fullscreenInsetBottomName("fullscreen-inset-bottom", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<AtomString> fullscreenInsetRightName("fullscreen-inset-right", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<AtomString> fullscreenAutoHideDurationName("fullscreen-auto-hide-duration", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> safeAreaInsetTopName("safe-area-inset-top", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> safeAreaInsetRightName("safe-area-inset-right", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> safeAreaInsetBottomName("safe-area-inset-bottom", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> safeAreaInsetLeftName("safe-area-inset-left", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> fullscreenInsetTopName("fullscreen-inset-top", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> fullscreenInsetLeftName("fullscreen-inset-left", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> fullscreenInsetBottomName("fullscreen-inset-bottom", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> fullscreenInsetRightName("fullscreen-inset-right", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> fullscreenAutoHideDurationName("fullscreen-auto-hide-duration", AtomString::ConstructFromLiteral);
 
     switch (property) {
     case ConstantProperty::SafeAreaInsetTop:
index 1844bf2..e9c94ff 100644 (file)
@@ -1259,7 +1259,7 @@ CustomElementNameValidationStatus Document::validateCustomElementName(const Atom
 #if ENABLE(MATHML)
     const auto& annotationXmlLocalName = MathMLNames::annotation_xmlTag->localName();
 #else
-    static NeverDestroyed<const AtomString> annotationXmlLocalName("annotation-xml", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> annotationXmlLocalName("annotation-xml", AtomString::ConstructFromLiteral);
 #endif
 
     if (localName == SVGNames::color_profileTag->localName()
index fb29590..bed97e1 100644 (file)
@@ -149,7 +149,7 @@ inline bool isValidCSSContentType(Element& element, const AtomString& type)
     // FIXME: Should MIME types really be case sensitive in XML documents? Doesn't seem like they should,
     // even though other things are case sensitive in that context. MIME types should never be case sensitive.
     // We should verify this and then remove the isHTMLElement check here.
-    static NeverDestroyed<const AtomString> cssContentType("text/css", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> cssContentType("text/css", AtomString::ConstructFromLiteral);
     return element.isHTMLElement() ? equalLettersIgnoringASCIICase(type, "text/css") : type == cssContentType;
 }
 
index 519320d..e964ef3 100644 (file)
@@ -174,19 +174,19 @@ private:
 
 const AtomString& ChildListRecord::type()
 {
-    static NeverDestroyed<AtomString> childList("childList", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> childList("childList", AtomString::ConstructFromLiteral);
     return childList;
 }
 
 const AtomString& AttributesRecord::type()
 {
-    static NeverDestroyed<AtomString> attributes("attributes", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> attributes("attributes", AtomString::ConstructFromLiteral);
     return attributes;
 }
 
 const AtomString& CharacterDataRecord::type()
 {
-    static NeverDestroyed<AtomString> characterData("characterData", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> characterData("characterData", AtomString::ConstructFromLiteral);
     return characterData;
 }
 
index 7041f12..b538926 100755 (executable)
@@ -115,7 +115,7 @@ if (length($fontNamesIn)) {
 #include <wtf/text/AtomString.h>
 END
 
-    printMacros($F, "extern LazyNeverDestroyed<const WTF::AtomString>", "", \%parameters);
+    printMacros($F, "extern MainThreadLazyNeverDestroyed<const WTF::AtomString>", "", \%parameters);
     print F "#endif\n\n";
 
     printInit($F, 1);
@@ -129,7 +129,7 @@ END
 
     print F StaticString::GenerateStrings(\%parameters);
 
-    printMacros($F, "LazyNeverDestroyed<const WTF::AtomString>", "", \%parameters);
+    printMacros($F, "MainThreadLazyNeverDestroyed<const WTF::AtomString>", "", \%parameters);
 
     printInit($F, 0);
 
@@ -722,7 +722,7 @@ END
     my $lowercaseNamespacePrefix = lc($parameters{namespacePrefix});
 
     print F "// Namespace\n";
-    print F "WEBCORE_EXPORT extern LazyNeverDestroyed<const WTF::AtomString> ${lowercaseNamespacePrefix}NamespaceURI;\n\n";
+    print F "WEBCORE_EXPORT extern MainThreadLazyNeverDestroyed<const WTF::AtomString> ${lowercaseNamespacePrefix}NamespaceURI;\n\n";
 
     if (keys %allTags) {
         print F "// Tags\n";
@@ -760,7 +760,7 @@ sub printNamesCppFile
     
     my $lowercaseNamespacePrefix = lc($parameters{namespacePrefix});
 
-    print F "LazyNeverDestroyed<const AtomString> ${lowercaseNamespacePrefix}NamespaceURI;\n\n";
+    print F "MainThreadLazyNeverDestroyed<const AtomString> ${lowercaseNamespacePrefix}NamespaceURI;\n\n";
 
     print F StaticString::GenerateStrings(\%allStrings);
 
index 3a0f911..735be0f 100644 (file)
@@ -57,19 +57,19 @@ const AtomString& stringForAutocapitalizeType(AutocapitalizeType type)
     case AutocapitalizeTypeDefault:
         return nullAtom();
     case AutocapitalizeTypeNone: {
-        static NeverDestroyed<const AtomString> valueNone("none", AtomString::ConstructFromLiteral);
+        static MainThreadNeverDestroyed<const AtomString> valueNone("none", AtomString::ConstructFromLiteral);
         return valueNone;
     }
     case AutocapitalizeTypeSentences: {
-        static NeverDestroyed<const AtomString> valueSentences("sentences", AtomString::ConstructFromLiteral);
+        static MainThreadNeverDestroyed<const AtomString> valueSentences("sentences", AtomString::ConstructFromLiteral);
         return valueSentences;
     }
     case AutocapitalizeTypeWords: {
-        static NeverDestroyed<const AtomString> valueWords("words", AtomString::ConstructFromLiteral);
+        static MainThreadNeverDestroyed<const AtomString> valueWords("words", AtomString::ConstructFromLiteral);
         return valueWords;
     }
     case AutocapitalizeTypeAllCharacters: {
-        static NeverDestroyed<const AtomString> valueAllCharacters("characters", AtomString::ConstructFromLiteral);
+        static MainThreadNeverDestroyed<const AtomString> valueAllCharacters("characters", AtomString::ConstructFromLiteral);
         return valueAllCharacters;
     }
     }
index a0a7d77..6735e26 100644 (file)
@@ -132,11 +132,11 @@ AutofillFieldName toAutofillFieldName(const AtomString& value)
 
 static inline bool isContactToken(const AtomString& token)
 {
-    static NeverDestroyed<AtomString> home("home", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<AtomString> work("work", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<AtomString> mobile("mobile", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<AtomString> fax("fax", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<AtomString> pager("pager", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> home("home", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> work("work", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> mobile("mobile", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> fax("fax", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> pager("pager", AtomString::ConstructFromLiteral);
 
     return token == home || token == work || token == mobile || token == fax || token == pager;
 }
@@ -161,8 +161,8 @@ static unsigned maxTokensForAutofillFieldCategory(AutofillCategory category)
 // https://html.spec.whatwg.org/multipage/forms.html#processing-model-3
 AutofillData AutofillData::createFromHTMLFormControlElement(const HTMLFormControlElement& element)
 {
-    static NeverDestroyed<AtomString> on("on", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<AtomString> off("off", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> on("on", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> off("off", AtomString::ConstructFromLiteral);
 
     // Label: Default
     // 26. Let the element's IDL-exposed autofill value be the empty string, and its autofill hint set and autofill scope be empty.
index ebb7d2a..a949956 100644 (file)
@@ -99,7 +99,7 @@ bool BaseCheckableInputType::accessKeyAction(bool sendMouseEvents)
 
 String BaseCheckableInputType::fallbackValue() const
 {
-    static NeverDestroyed<const AtomString> on("on", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> on("on", AtomString::ConstructFromLiteral);
     return on.get();
 }
 
index 7b1061f..5421fdb 100644 (file)
@@ -61,7 +61,7 @@ void BaseChooserOnlyDateAndTimeInputType::handleDOMActivateEvent(Event&)
 
 void BaseChooserOnlyDateAndTimeInputType::createShadowSubtree()
 {
-    static NeverDestroyed<AtomString> valueContainerPseudo("-webkit-date-and-time-value", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> valueContainerPseudo("-webkit-date-and-time-value", AtomString::ConstructFromLiteral);
 
     ASSERT(element());
     auto valueContainer = HTMLDivElement::create(element()->document());
index 9e2f04c..d4c858a 100644 (file)
@@ -143,9 +143,8 @@ void ColorInputType::createShadowSubtree()
     ASSERT(element());
     ASSERT(element()->shadowRoot());
 
-    static NeverDestroyed<const AtomString> webkitColorSwatchName("-webkit-color-swatch", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<const AtomString> webkitColorSwatchWrapperName("-webkit-color-swatch-wrapper", AtomString::ConstructFromLiteral);
-    ASSERT(isMainThread());
+    static MainThreadNeverDestroyed<const AtomString> webkitColorSwatchName("-webkit-color-swatch", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> webkitColorSwatchWrapperName("-webkit-color-swatch-wrapper", AtomString::ConstructFromLiteral);
 
     Document& document = element()->document();
     auto wrapperElement = HTMLDivElement::create(document);
index a8edc99..3e2f9be 100644 (file)
@@ -89,9 +89,8 @@ Ref<UploadButtonElement> UploadButtonElement::createForMultiple(Document& docume
 UploadButtonElement::UploadButtonElement(Document& document)
     : HTMLInputElement(inputTag, document, 0, false)
 {
-    static NeverDestroyed<const AtomString> buttonName("button", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<const AtomString> webkitFileUploadButtonName("-webkit-file-upload-button", AtomString::ConstructFromLiteral);
-    ASSERT(isMainThread());
+    static MainThreadNeverDestroyed<const AtomString> buttonName("button", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> webkitFileUploadButtonName("-webkit-file-upload-button", AtomString::ConstructFromLiteral);
     setType(buttonName);
     setPseudo(webkitFileUploadButtonName);
 }
index 79db341..c7a709a 100644 (file)
@@ -320,7 +320,7 @@ AtomString FormKeyGenerator::formKey(const HTMLFormControlElementWithState& cont
 {
     auto form = makeRefPtr(ownerFormForState(control));
     if (!form) {
-        static NeverDestroyed<AtomString> formKeyForNoOwner("No owner", AtomString::ConstructFromLiteral);
+        static MainThreadNeverDestroyed<const AtomString> formKeyForNoOwner("No owner", AtomString::ConstructFromLiteral);
         return formKeyForNoOwner;
     }
 
index 009f554..6fc9b47 100644 (file)
@@ -253,9 +253,9 @@ void HTMLAnchorElement::parseAttribute(const QualifiedName& name, const AtomStri
         // Do nothing.
     } else if (name == relAttr) {
         // Update HTMLAnchorElement::relList() if more rel attributes values are supported.
-        static NeverDestroyed<AtomString> noReferrer("noreferrer", AtomString::ConstructFromLiteral);
-        static NeverDestroyed<AtomString> noOpener("noopener", AtomString::ConstructFromLiteral);
-        static NeverDestroyed<AtomString> opener("opener", AtomString::ConstructFromLiteral);
+        static MainThreadNeverDestroyed<const AtomString> noReferrer("noreferrer", AtomString::ConstructFromLiteral);
+        static MainThreadNeverDestroyed<const AtomString> noOpener("noopener", AtomString::ConstructFromLiteral);
+        static MainThreadNeverDestroyed<const AtomString> opener("opener", AtomString::ConstructFromLiteral);
         const bool shouldFoldCase = true;
         SpaceSplitString relValue(value, shouldFoldCase);
         if (relValue.contains(noReferrer))
@@ -381,7 +381,7 @@ bool HTMLAnchorElement::isSystemPreviewLink() const
     if (!RuntimeEnabledFeatures::sharedFeatures().systemPreviewEnabled())
         return false;
 
-    static NeverDestroyed<AtomString> systemPreviewRelValue("ar", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> systemPreviewRelValue("ar", AtomString::ConstructFromLiteral);
 
     if (!relList().contains(systemPreviewRelValue))
         return false;
index 71fe1a0..42a29cc 100644 (file)
@@ -74,15 +74,15 @@ const AtomString& HTMLButtonElement::formControlType() const
 {
     switch (m_type) {
         case SUBMIT: {
-            static NeverDestroyed<const AtomString> submit("submit", AtomString::ConstructFromLiteral);
+            static MainThreadNeverDestroyed<const AtomString> submit("submit", AtomString::ConstructFromLiteral);
             return submit;
         }
         case BUTTON: {
-            static NeverDestroyed<const AtomString> button("button", AtomString::ConstructFromLiteral);
+            static MainThreadNeverDestroyed<const AtomString> button("button", AtomString::ConstructFromLiteral);
             return button;
         }
         case RESET: {
-            static NeverDestroyed<const AtomString> reset("reset", AtomString::ConstructFromLiteral);
+            static MainThreadNeverDestroyed<const AtomString> reset("reset", AtomString::ConstructFromLiteral);
             return reset;
         }
     }
index 60dd1fb..07cb164 100644 (file)
@@ -51,7 +51,7 @@ static DetailEventSender& detailToggleEventSender()
 
 static const AtomString& summarySlotName()
 {
-    static NeverDestroyed<AtomString> summarySlot("summarySlot");
+    static MainThreadNeverDestroyed<const AtomString> summarySlot("summarySlot");
     return summarySlot;
 }
 
index 7a6a6fe..5b7f9af 100644 (file)
@@ -505,9 +505,9 @@ static Ref<DocumentFragment> textToFragment(Document& document, const String& te
 // http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-interfaces.html#limited-to-only-known-values
 static inline const AtomString& toValidDirValue(const AtomString& value)
 {
-    static NeverDestroyed<AtomString> ltrValue("ltr", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<AtomString> rtlValue("rtl", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<AtomString> autoValue("auto", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> ltrValue("ltr", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> rtlValue("rtl", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> autoValue("auto", AtomString::ConstructFromLiteral);
     if (equalLettersIgnoringASCIICase(value, "ltr"))
         return ltrValue;
     if (equalLettersIgnoringASCIICase(value, "rtl"))
@@ -662,22 +662,19 @@ String HTMLElement::contentEditable() const
 
 static const AtomString& trueName()
 {
-    static NeverDestroyed<const AtomString> trueValue("true", AtomString::ConstructFromLiteral);
-    ASSERT(isMainThread());
+    static MainThreadNeverDestroyed<const AtomString> trueValue("true", AtomString::ConstructFromLiteral);
     return trueValue.get();
 }
 
 static const AtomString& falseName()
 {
-    static NeverDestroyed<const AtomString> falseValue("false", AtomString::ConstructFromLiteral);
-    ASSERT(isMainThread());
+    static MainThreadNeverDestroyed<const AtomString> falseValue("false", AtomString::ConstructFromLiteral);
     return falseValue.get();
 }
 
 static const AtomString& plaintextOnlyName()
 {
-    static NeverDestroyed<const AtomString> plaintextOnlyValue("plaintext-only", AtomString::ConstructFromLiteral);
-    ASSERT(isMainThread());
+    static MainThreadNeverDestroyed<const AtomString> plaintextOnlyValue("plaintext-only", AtomString::ConstructFromLiteral);
     return plaintextOnlyValue.get();
 }
 
@@ -1117,9 +1114,8 @@ bool HTMLElement::shouldAutocorrect() const
 
 void HTMLElement::setAutocorrect(bool autocorrect)
 {
-    static NeverDestroyed<const AtomString> onName("on", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<const AtomString> offName("off", AtomString::ConstructFromLiteral);
-    ASSERT(isMainThread());
+    static MainThreadNeverDestroyed<const AtomString> onName("on", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> offName("off", AtomString::ConstructFromLiteral);
     setAttributeWithoutSynchronization(autocorrectAttr, autocorrect ? onName.get() : offName.get());
 }
 
index 51ab018..621840c 100644 (file)
@@ -154,7 +154,7 @@ bool HTMLFieldSetElement::supportsFocus() const
 
 const AtomString& HTMLFieldSetElement::formControlType() const
 {
-    static NeverDestroyed<const AtomString> fieldset("fieldset", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> fieldset("fieldset", AtomString::ConstructFromLiteral);
     return fieldset;
 }
 
index 620d2c4..665ace4 100644 (file)
@@ -906,8 +906,8 @@ void HTMLFormElement::setAutocomplete(const AtomString& value)
 
 const AtomString& HTMLFormElement::autocomplete() const
 {
-    static NeverDestroyed<AtomString> on("on", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<AtomString> off("off", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> on("on", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> off("off", AtomString::ConstructFromLiteral);
 
     return equalIgnoringASCIICase(attributeWithoutSynchronization(autocompleteAttr), "off") ? off : on;
 }
index ca00639..854b6bf 100644 (file)
@@ -903,8 +903,8 @@ size_t HTMLImageElement::pendingDecodePromisesCountForTesting() const
 
 const AtomString& HTMLImageElement::loadingForBindings() const
 {
-    static NeverDestroyed<AtomString> eager("eager", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<AtomString> lazy("lazy", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> eager("eager", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> lazy("lazy", AtomString::ConstructFromLiteral);
     auto& attributeValue = attributeWithoutSynchronization(HTMLNames::loadingAttr);
     return hasLazyLoadableAttributeValue(attributeValue) ? lazy : eager;
 }
index 780b791..16510cf 100644 (file)
@@ -57,7 +57,7 @@ private:
     KeygenSelectElement(Document& document)
         : HTMLSelectElement(selectTag, document, 0)
     {
-        static NeverDestroyed<AtomString> pseudoId("-webkit-keygen-select", AtomString::ConstructFromLiteral);
+        static MainThreadNeverDestroyed<const AtomString> pseudoId("-webkit-keygen-select", AtomString::ConstructFromLiteral);
         setPseudo(pseudoId);
     }
 
@@ -130,7 +130,7 @@ bool HTMLKeygenElement::appendFormData(DOMFormData& formData, bool)
 
 const AtomString& HTMLKeygenElement::formControlType() const
 {
-    static NeverDestroyed<const AtomString> keygen("keygen", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> keygen("keygen", AtomString::ConstructFromLiteral);
     return keygen;
 }
 
index 9fe9e14..93a6f4c 100644 (file)
@@ -68,7 +68,7 @@ bool HTMLOptGroupElement::isFocusable() const
 
 const AtomString& HTMLOptGroupElement::formControlType() const
 {
-    static NeverDestroyed<const AtomString> optgroup("optgroup", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> optgroup("optgroup", AtomString::ConstructFromLiteral);
     return optgroup;
 }
 
index 56b7206..360665b 100644 (file)
@@ -57,7 +57,7 @@ Ref<HTMLOutputElement> HTMLOutputElement::create(const QualifiedName& tagName, D
 
 const AtomString& HTMLOutputElement::formControlType() const
 {
-    static NeverDestroyed<const AtomString> output("output", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> output("output", AtomString::ConstructFromLiteral);
     return output;
 }
 
index 7f0354f..1dbd454 100644 (file)
@@ -422,7 +422,7 @@ void HTMLPlugInImageElement::didAddUserAgentShadowRoot(ShadowRoot& root)
 
 bool HTMLPlugInImageElement::partOfSnapshotOverlay(const EventTarget* target) const
 {
-    static NeverDestroyed<AtomString> selector(".snapshot-overlay", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> selector(".snapshot-overlay", AtomString::ConstructFromLiteral);
     auto shadow = userAgentShadowRoot();
     if (!shadow)
         return false;
index ee43736..3133d03 100644 (file)
@@ -100,8 +100,8 @@ void HTMLSelectElement::didRecalcStyle(Style::Change styleChange)
 
 const AtomString& HTMLSelectElement::formControlType() const
 {
-    static NeverDestroyed<const AtomString> selectMultiple("select-multiple", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<const AtomString> selectOne("select-one", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> selectMultiple("select-multiple", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> selectOne("select-one", AtomString::ConstructFromLiteral);
     return m_multiple ? selectMultiple : selectOne;
 }
 
index a60038f..c06a3e5 100644 (file)
@@ -169,10 +169,10 @@ void HTMLTableCellElement::setRowSpanForBindings(unsigned n)
 const AtomString& HTMLTableCellElement::scope() const
 {
     // https://html.spec.whatwg.org/multipage/tables.html#attr-th-scope
-    static NeverDestroyed<const AtomString> row("row", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<const AtomString> col("col", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<const AtomString> rowgroup("rowgroup", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<const AtomString> colgroup("colgroup", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> row("row", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> col("col", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> rowgroup("rowgroup", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> colgroup("colgroup", AtomString::ConstructFromLiteral);
 
     const AtomString& value = attributeWithoutSynchronization(HTMLNames::scopeAttr);
 
index e19504b..a89883f 100644 (file)
@@ -111,7 +111,7 @@ void HTMLTextAreaElement::didAddUserAgentShadowRoot(ShadowRoot& root)
 
 const AtomString& HTMLTextAreaElement::formControlType() const
 {
-    static NeverDestroyed<const AtomString> textarea("textarea", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> textarea("textarea", AtomString::ConstructFromLiteral);
     return textarea;
 }
 
index 388ecb8..3dc463b 100644 (file)
@@ -397,9 +397,9 @@ int HTMLTextFormControlElement::computeSelectionEnd() const
 
 static const AtomString& directionString(TextFieldSelectionDirection direction)
 {
-    static NeverDestroyed<const AtomString> none("none", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<const AtomString> forward("forward", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<const AtomString> backward("backward", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> none("none", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> forward("forward", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> backward("backward", AtomString::ConstructFromLiteral);
 
     switch (direction) {
     case SelectionHasNoDirection:
@@ -535,9 +535,8 @@ bool HTMLTextFormControlElement::isInnerTextElementEditable() const
 void HTMLTextFormControlElement::updateInnerTextElementEditability()
 {
     if (auto innerText = innerTextElement()) {
-        static NeverDestroyed<const AtomString> plainTextOnlyName("plaintext-only", AtomString::ConstructFromLiteral);
-        static NeverDestroyed<const AtomString> falseName("false", AtomString::ConstructFromLiteral);
-        ASSERT(isMainThread());
+        static MainThreadNeverDestroyed<const AtomString> plainTextOnlyName("plaintext-only", AtomString::ConstructFromLiteral);
+        static MainThreadNeverDestroyed<const AtomString> falseName("false", AtomString::ConstructFromLiteral);
         const auto& value = isInnerTextElementEditable() ? plainTextOnlyName.get() : falseName.get();
         innerText->setAttributeWithoutSynchronization(contenteditableAttr, value);
     }
index a20eacc..349d85b 100644 (file)
@@ -82,49 +82,49 @@ namespace InputModeNames {
 
 const AtomString& none()
 {
-    static NeverDestroyed<AtomString> mode("none", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> mode("none", AtomString::ConstructFromLiteral);
     return mode;
 }
 
 const AtomString& text()
 {
-    static NeverDestroyed<AtomString> mode("text", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> mode("text", AtomString::ConstructFromLiteral);
     return mode;
 }
 
 const AtomString& tel()
 {
-    static NeverDestroyed<AtomString> mode("tel", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> mode("tel", AtomString::ConstructFromLiteral);
     return mode;
 }
 
 const AtomString& url()
 {
-    static NeverDestroyed<AtomString> mode("url", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> mode("url", AtomString::ConstructFromLiteral);
     return mode;
 }
 
 const AtomString& email()
 {
-    static NeverDestroyed<AtomString> mode("email", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> mode("email", AtomString::ConstructFromLiteral);
     return mode;
 }
 
 const AtomString& numeric()
 {
-    static NeverDestroyed<AtomString> mode("numeric", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> mode("numeric", AtomString::ConstructFromLiteral);
     return mode;
 }
 
 const AtomString& decimal()
 {
-    static NeverDestroyed<AtomString> mode("decimal", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> mode("decimal", AtomString::ConstructFromLiteral);
     return mode;
 }
 
 const AtomString& search()
 {
-    static NeverDestroyed<AtomString> mode("search", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> mode("search", AtomString::ConstructFromLiteral);
     return mode;
 }
 
index a8a6e79..3e26d70 100644 (file)
@@ -33,139 +33,139 @@ namespace InputTypeNames {
 
 const AtomString& button()
 {
-    static NeverDestroyed<AtomString> name("button", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> name("button", AtomString::ConstructFromLiteral);
     return name;
 }
 
 const AtomString& checkbox()
 {
-    static NeverDestroyed<AtomString> name("checkbox", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> name("checkbox", AtomString::ConstructFromLiteral);
     return name;
 }
 
 const AtomString& color()
 {
-    static NeverDestroyed<AtomString> name("color", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> name("color", AtomString::ConstructFromLiteral);
     return name;
 }
 
 const AtomString& date()
 {
-    static NeverDestroyed<AtomString> name("date", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> name("date", AtomString::ConstructFromLiteral);
     return name;
 }
 
 const AtomString& datetime()
 {
-    static NeverDestroyed<AtomString> name("datetime", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> name("datetime", AtomString::ConstructFromLiteral);
     return name;
 }
 
 const AtomString& datetimelocal()
 {
-    static NeverDestroyed<AtomString> name("datetime-local", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> name("datetime-local", AtomString::ConstructFromLiteral);
     return name;
 }
 
 const AtomString& email()
 {
-    static NeverDestroyed<AtomString> name("email", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> name("email", AtomString::ConstructFromLiteral);
     return name;
 }
 
 const AtomString& file()
 {
-    static NeverDestroyed<AtomString> name("file", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> name("file", AtomString::ConstructFromLiteral);
     return name;
 }
 
 const AtomString& hidden()
 {
-    static NeverDestroyed<AtomString> name("hidden", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> name("hidden", AtomString::ConstructFromLiteral);
     return name;
 }
 
 const AtomString& image()
 {
-    static NeverDestroyed<AtomString> name("image", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> name("image", AtomString::ConstructFromLiteral);
     return name;
 }
 
 const AtomString& month()
 {
-    static NeverDestroyed<AtomString> name("month", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> name("month", AtomString::ConstructFromLiteral);
     return name;
 }
 
 const AtomString& number()
 {
-    static NeverDestroyed<AtomString> name("number", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> name("number", AtomString::ConstructFromLiteral);
     return name;
 }
 
 const AtomString& password()
 {
-    static NeverDestroyed<AtomString> name("password", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> name("password", AtomString::ConstructFromLiteral);
     return name;
 }
 
 const AtomString& radio()
 {
-    static NeverDestroyed<AtomString> name("radio", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> name("radio", AtomString::ConstructFromLiteral);
     return name;
 }
 
 const AtomString& range()
 {
-    static NeverDestroyed<AtomString> name("range", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> name("range", AtomString::ConstructFromLiteral);
     return name;
 }
 
 const AtomString& reset()
 {
-    static NeverDestroyed<AtomString> name("reset", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> name("reset", AtomString::ConstructFromLiteral);
     return name;
 }
 
 const AtomString& search()
 {
-    static NeverDestroyed<AtomString> name("search", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> name("search", AtomString::ConstructFromLiteral);
     return name;
 }
 
 const AtomString& submit()
 {
-    static NeverDestroyed<AtomString> name("submit", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> name("submit", AtomString::ConstructFromLiteral);
     return name;
 }
 
 const AtomString& telephone()
 {
-    static NeverDestroyed<AtomString> name("tel", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> name("tel", AtomString::ConstructFromLiteral);
     return name;
 }
 
 const AtomString& text()
 {
-    static NeverDestroyed<AtomString> name("text", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> name("text", AtomString::ConstructFromLiteral);
     return name;
 }
 
 const AtomString& time()
 {
-    static NeverDestroyed<AtomString> name("time", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> name("time", AtomString::ConstructFromLiteral);
     return name;
 }
 
 const AtomString& url()
 {
-    static NeverDestroyed<AtomString> name("url", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> name("url", AtomString::ConstructFromLiteral);
     return name;
 }
 
 const AtomString& week()
 {
-    static NeverDestroyed<AtomString> name("week", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> name("week", AtomString::ConstructFromLiteral);
     return name;
 }
 
index e482b36..321150c 100644 (file)
@@ -289,19 +289,19 @@ void MediaController::setMuted(bool flag)
 
 static const AtomString& playbackStateWaiting()
 {
-    static NeverDestroyed<AtomString> waiting("waiting", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> waiting("waiting", AtomString::ConstructFromLiteral);
     return waiting;
 }
 
 static const AtomString& playbackStatePlaying()
 {
-    static NeverDestroyed<AtomString> playing("playing", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> playing("playing", AtomString::ConstructFromLiteral);
     return playing;
 }
 
 static const AtomString& playbackStateEnded()
 {
-    static NeverDestroyed<AtomString> ended("ended", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> ended("ended", AtomString::ConstructFromLiteral);
     return ended;
 }
 
index db636e2..df5eb35 100644 (file)
@@ -255,8 +255,7 @@ void RangeInputType::createShadowSubtree()
     ASSERT(element());
     ASSERT(element()->userAgentShadowRoot());
 
-    static NeverDestroyed<const AtomString> webkitSliderRunnableTrackName("-webkit-slider-runnable-track", AtomString::ConstructFromLiteral);
-    ASSERT(isMainThread());
+    static MainThreadNeverDestroyed<const AtomString> webkitSliderRunnableTrackName("-webkit-slider-runnable-track", AtomString::ConstructFromLiteral);
     Document& document = element()->document();
     auto track = HTMLDivElement::create(document);
     track->setPseudo(webkitSliderRunnableTrackName);
index 771cf47..187f3f6 100644 (file)
@@ -64,10 +64,9 @@ void SearchInputType::addSearchResult()
 
 static void updateResultButtonPseudoType(SearchFieldResultsButtonElement& resultButton, int maxResults)
 {
-    static NeverDestroyed<const AtomString> webkitSearchDecorationName("-webkit-search-decoration", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<const AtomString> webkitSearchResultsDecorationName("-webkit-search-results-decoration", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<const AtomString> webkitSearchResultsButtonName("-webkit-search-results-button", AtomString::ConstructFromLiteral);
-    ASSERT(isMainThread());
+    static MainThreadNeverDestroyed<const AtomString> webkitSearchDecorationName("-webkit-search-decoration", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> webkitSearchResultsDecorationName("-webkit-search-results-decoration", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> webkitSearchResultsButtonName("-webkit-search-results-button", AtomString::ConstructFromLiteral);
     if (!maxResults)
         resultButton.setPseudo(webkitSearchResultsDecorationName);
     else if (maxResults < 0)
index 2f59e45..2de43da 100644 (file)
@@ -348,8 +348,7 @@ void TextFieldInputType::createShadowSubtree()
     }
 
     if (shouldHaveCapsLockIndicator) {
-        static NeverDestroyed<const AtomString> webkitCapsLockIndicatorName("-webkit-caps-lock-indicator", AtomString::ConstructFromLiteral);
-        ASSERT(isMainThread());
+        static MainThreadNeverDestroyed<const AtomString> webkitCapsLockIndicatorName("-webkit-caps-lock-indicator", AtomString::ConstructFromLiteral);
         m_capsLockIndicator = HTMLDivElement::create(document);
         m_capsLockIndicator->setPseudo(webkitCapsLockIndicatorName);
 
@@ -457,8 +456,7 @@ void TextFieldInputType::createDataListDropdownIndicator()
     if (!m_container)
         createContainer();
 
-    static NeverDestroyed<const AtomString> webkitListButtonName("-webkit-list-button", AtomString::ConstructFromLiteral);
-    ASSERT(isMainThread());
+    static MainThreadNeverDestroyed<const AtomString> webkitListButtonName("-webkit-list-button", AtomString::ConstructFromLiteral);
     ScriptDisallowedScope::EventAllowedScope allowedScope(*m_container);
     m_dataListDropdownIndicator = DataListButtonElement::create(element()->document(), *this);
     m_container->appendChild(*m_dataListDropdownIndicator);
@@ -782,8 +780,7 @@ void TextFieldInputType::createContainer()
     ASSERT(!m_container);
     ASSERT(element());
 
-    static NeverDestroyed<const AtomString> webkitTextfieldDecorationContainerName("-webkit-textfield-decoration-container", AtomString::ConstructFromLiteral);
-    ASSERT(isMainThread());
+    static MainThreadNeverDestroyed<const AtomString> webkitTextfieldDecorationContainerName("-webkit-textfield-decoration-container", AtomString::ConstructFromLiteral);
 
     ScriptDisallowedScope::EventAllowedScope allowedScope(*element()->userAgentShadowRoot());
 
@@ -803,8 +800,7 @@ void TextFieldInputType::createAutoFillButton(AutoFillButtonType autoFillButtonT
     if (autoFillButtonType == AutoFillButtonType::None)
         return;
 
-    static NeverDestroyed<const AtomString> buttonName("button", AtomString::ConstructFromLiteral);
-    ASSERT(isMainThread());
+    static MainThreadNeverDestroyed<const AtomString> buttonName("button", AtomString::ConstructFromLiteral);
     ASSERT(element());
     m_autoFillButton = AutoFillButtonElement::create(element()->document(), *this);
     m_autoFillButton->setPseudo(autoFillButtonTypeToAutoFillButtonPseudoClassName(autoFillButtonType));
index c8cc6b4..99c9a68 100644 (file)
@@ -181,15 +181,14 @@ void ValidationMessage::buildBubbleTree()
 
     ShadowRoot& shadowRoot = m_element->ensureUserAgentShadowRoot();
 
-    static NeverDestroyed<const AtomString> webkitValidationBubbleName("-webkit-validation-bubble", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<const AtomString> webkitValidationBubbleArrowClipperName("-webkit-validation-bubble-arrow-clipper", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<const AtomString> webkitValidationBubbleArrowName("-webkit-validation-bubble-arrow", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<const AtomString> webkitValidationBubbleMessageName("-webkit-validation-bubble-message", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<const AtomString> webkitValidationBubbleIconName("-webkit-validation-bubble-icon", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<const AtomString> webkitValidationBubbleTextBlockName("-webkit-validation-bubble-text-block", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<const AtomString> webkitValidationBubbleHeadingName("-webkit-validation-bubble-heading", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<const AtomString> webkitValidationBubbleBodyName("-webkit-validation-bubble-body", AtomString::ConstructFromLiteral);
-    ASSERT(isMainThread());
+    static MainThreadNeverDestroyed<const AtomString> webkitValidationBubbleName("-webkit-validation-bubble", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> webkitValidationBubbleArrowClipperName("-webkit-validation-bubble-arrow-clipper", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> webkitValidationBubbleArrowName("-webkit-validation-bubble-arrow", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> webkitValidationBubbleMessageName("-webkit-validation-bubble-message", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> webkitValidationBubbleIconName("-webkit-validation-bubble-icon", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> webkitValidationBubbleTextBlockName("-webkit-validation-bubble-text-block", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> webkitValidationBubbleHeadingName("-webkit-validation-bubble-heading", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> webkitValidationBubbleBodyName("-webkit-validation-bubble-body", AtomString::ConstructFromLiteral);
 
     Document& document = m_element->document();
     m_bubble = HTMLDivElement::create(document);
index 2f166f7..12d50fc 100644 (file)
@@ -49,8 +49,7 @@ Ref<DetailsMarkerControl> DetailsMarkerControl::create(Document& document)
 DetailsMarkerControl::DetailsMarkerControl(Document& document)
     : HTMLDivElement(HTMLNames::divTag, document)
 {
-    static NeverDestroyed<const AtomString> webkitDetailsMarkerName("-webkit-details-marker", AtomString::ConstructFromLiteral);
-    ASSERT(isMainThread());
+    static MainThreadNeverDestroyed<const AtomString> webkitDetailsMarkerName("-webkit-details-marker", AtomString::ConstructFromLiteral);
     setPseudo(webkitDetailsMarkerName);
 }
 
index 4f51b52..1d3e92d 100644 (file)
@@ -77,8 +77,7 @@ MediaControlTextTrackContainerElement::MediaControlTextTrackContainerElement(Doc
     : HTMLDivElement(divTag, document)
     , m_mediaElement(makeWeakPtr(&element))
 {
-    static NeverDestroyed<const AtomString> webkitMediaTextTrackContainerName("-webkit-media-text-track-container", AtomString::ConstructFromLiteral);
-    ASSERT(isMainThread());
+    static MainThreadNeverDestroyed<const AtomString> webkitMediaTextTrackContainerName("-webkit-media-text-track-container", AtomString::ConstructFromLiteral);
     setPseudo(webkitMediaTextTrackContainerName);
 }
 
index 6bc1170..f574f07 100644 (file)
@@ -91,8 +91,7 @@ void ProgressValueElement::setWidthPercentage(double width)
 
 Ref<ProgressInnerElement> ProgressInnerElement::create(Document& document)
 {
-    static NeverDestroyed<const AtomString> webkitProgressInnerElementName("-webkit-progress-inner-element", AtomString::ConstructFromLiteral);
-    ASSERT(isMainThread());
+    static MainThreadNeverDestroyed<const AtomString> webkitProgressInnerElementName("-webkit-progress-inner-element", AtomString::ConstructFromLiteral);
     Ref<ProgressInnerElement> result = adoptRef(*new ProgressInnerElement(document));
     result->setPseudo(webkitProgressInnerElementName);
     return result;
@@ -100,8 +99,7 @@ Ref<ProgressInnerElement> ProgressInnerElement::create(Document& document)
 
 Ref<ProgressBarElement> ProgressBarElement::create(Document& document)
 {
-    static NeverDestroyed<const AtomString> webkitProgressBarName("-webkit-progress-bar", AtomString::ConstructFromLiteral);
-    ASSERT(isMainThread());
+    static MainThreadNeverDestroyed<const AtomString> webkitProgressBarName("-webkit-progress-bar", AtomString::ConstructFromLiteral);
     Ref<ProgressBarElement> result = adoptRef(*new ProgressBarElement(document));
     result->setPseudo(webkitProgressBarName);
     return result;
@@ -109,8 +107,7 @@ Ref<ProgressBarElement> ProgressBarElement::create(Document& document)
 
 Ref<ProgressValueElement> ProgressValueElement::create(Document& document)
 {
-    static NeverDestroyed<const AtomString> webkitProgressValueName("-webkit-progress-value", AtomString::ConstructFromLiteral);
-    ASSERT(isMainThread());
+    static MainThreadNeverDestroyed<const AtomString> webkitProgressValueName("-webkit-progress-value", AtomString::ConstructFromLiteral);
     Ref<ProgressValueElement> result = adoptRef(*new ProgressValueElement(document));
     result->setPseudo(webkitProgressValueName);
     return result;
index 3533e8b..68a490e 100644 (file)
@@ -587,8 +587,8 @@ Optional<Style::ElementStyle> SliderThumbElement::resolveCustomStyle(const Rende
 {
     // This doesn't actually compute style. This is just a hack to pick shadow pseudo id when host style is known.
 
-    static NeverDestroyed<const AtomString> sliderThumbShadowPseudoId("-webkit-slider-thumb", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<const AtomString> mediaSliderThumbShadowPseudoId("-webkit-media-slider-thumb", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> sliderThumbShadowPseudoId("-webkit-slider-thumb", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> mediaSliderThumbShadowPseudoId("-webkit-media-slider-thumb", AtomString::ConstructFromLiteral);
 
     if (!hostStyle)
         return WTF::nullopt;
@@ -641,8 +641,8 @@ Optional<Style::ElementStyle> SliderContainerElement::resolveCustomStyle(const R
 {
     // This doesn't actually compute style. This is just a hack to pick shadow pseudo id when host style is known.
 
-    static NeverDestroyed<const AtomString> mediaSliderContainer("-webkit-media-slider-container", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<const AtomString> sliderContainer("-webkit-slider-container", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> mediaSliderContainer("-webkit-media-slider-container", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> sliderContainer("-webkit-slider-container", AtomString::ConstructFromLiteral);
 
     if (!hostStyle)
         return WTF::nullopt;
index 9e328f6..9846d03 100644 (file)
@@ -55,8 +55,7 @@ inline SpinButtonElement::SpinButtonElement(Document& document, SpinButtonOwner&
     , m_pressStartingState(Indeterminate)
     , m_repeatingTimer(*this, &SpinButtonElement::repeatingTimerFired)
 {
-    static NeverDestroyed<const AtomString> webkitInnerSpinButtonName("-webkit-inner-spin-button", AtomString::ConstructFromLiteral);
-    ASSERT(isMainThread());
+    static MainThreadNeverDestroyed<const AtomString> webkitInnerSpinButtonName("-webkit-inner-spin-button", AtomString::ConstructFromLiteral);
     setHasCustomStyleResolveCallbacks();
     setPseudo(webkitInnerSpinButtonName);
 }
index 7934ddc..b6d69c1 100644 (file)
@@ -182,8 +182,7 @@ Optional<Style::ElementStyle> TextControlInnerTextElement::resolveCustomStyle(co
 inline TextControlPlaceholderElement::TextControlPlaceholderElement(Document& document)
     : HTMLDivElement(divTag, document)
 {
-    static NeverDestroyed<const AtomString> placeholderName("placeholder", AtomString::ConstructFromLiteral);
-    ASSERT(isMainThread());
+    static MainThreadNeverDestroyed<const AtomString> placeholderName("placeholder", AtomString::ConstructFromLiteral);
     setPseudo(placeholderName);
     setHasCustomStyleResolveCallbacks();
 }
@@ -256,9 +255,8 @@ bool SearchFieldResultsButtonElement::willRespondToMouseClickEvents()
 inline SearchFieldCancelButtonElement::SearchFieldCancelButtonElement(Document& document)
     : HTMLDivElement(divTag, document)
 {
-    static NeverDestroyed<const AtomString> webkitSearchCancelButtonName("-webkit-search-cancel-button", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<const AtomString> buttonName("button", AtomString::ConstructFromLiteral);
-    ASSERT(isMainThread());
+    static MainThreadNeverDestroyed<const AtomString> webkitSearchCancelButtonName("-webkit-search-cancel-button", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> buttonName("button", AtomString::ConstructFromLiteral);
 
     setHasCustomStyleResolveCallbacks();
 
index 22f6209..975a65b 100644 (file)
@@ -41,8 +41,7 @@ Ref<YouTubeEmbedShadowElement> YouTubeEmbedShadowElement::create(Document& doc)
 YouTubeEmbedShadowElement::YouTubeEmbedShadowElement(Document& document)
     : HTMLDivElement(HTMLNames::divTag, document)
 {
-    static NeverDestroyed<const AtomString> webkitPluginReplacementName("-webkit-plugin-replacement", AtomString::ConstructFromLiteral);
-    ASSERT(isMainThread());
+    static MainThreadNeverDestroyed<const AtomString> webkitPluginReplacementName("-webkit-plugin-replacement", AtomString::ConstructFromLiteral);
     setPseudo(webkitPluginReplacementName);
 }
 
index 964316a..6d801a6 100644 (file)
@@ -94,8 +94,7 @@ RefPtr<ImageControlsButtonElementMac> ImageControlsButtonElementMac::tryCreate(D
     if (!document.page())
         return nullptr;
 
-    static NeverDestroyed<const AtomString> xWebkitImageControlsButtonName("x-webkit-image-controls-button", AtomString::ConstructFromLiteral);
-    ASSERT(isMainThread());
+    static MainThreadNeverDestroyed<const AtomString> xWebkitImageControlsButtonName("x-webkit-image-controls-button", AtomString::ConstructFromLiteral);
 
     auto button = adoptRef(*new ImageControlsButtonElementMac(document));
     button->setAttributeWithoutSynchronization(HTMLNames::classAttr, xWebkitImageControlsButtonName);
index 2f9df49..3aa4549 100644 (file)
@@ -86,8 +86,7 @@ RefPtr<ImageControlsRootElement> ImageControlsRootElement::tryCreate(Document& d
     if (!document.page())
         return nullptr;
 
-    static NeverDestroyed<const AtomString> xWebkitImageControlsName("x-webkit-image-controls", AtomString::ConstructFromLiteral);
-    ASSERT(isMainThread());
+    static MainThreadNeverDestroyed<const AtomString> xWebkitImageControlsName("x-webkit-image-controls", AtomString::ConstructFromLiteral);
 
     Ref<ImageControlsRootElementMac> controls = adoptRef(*new ImageControlsRootElementMac(document));
     controls->setAttributeWithoutSynchronization(HTMLNames::classAttr, xWebkitImageControlsName);
index 0209f9e..23a91d0 100644 (file)
@@ -41,37 +41,37 @@ namespace WebCore {
 
 const AtomString& AudioTrack::alternativeKeyword()
 {
-    static NeverDestroyed<AtomString> alternative("alternative", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> alternative("alternative", AtomString::ConstructFromLiteral);
     return alternative;
 }
 
 const AtomString& AudioTrack::descriptionKeyword()
 {
-    static NeverDestroyed<AtomString> description("description", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> description("description", AtomString::ConstructFromLiteral);
     return description;
 }
 
 const AtomString& AudioTrack::mainKeyword()
 {
-    static NeverDestroyed<AtomString> main("main", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> main("main", AtomString::ConstructFromLiteral);
     return main;
 }
 
 const AtomString& AudioTrack::mainDescKeyword()
 {
-    static NeverDestroyed<AtomString> mainDesc("main-desc", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> mainDesc("main-desc", AtomString::ConstructFromLiteral);
     return mainDesc;
 }
 
 const AtomString& AudioTrack::translationKeyword()
 {
-    static NeverDestroyed<AtomString> translation("translation", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> translation("translation", AtomString::ConstructFromLiteral);
     return translation;
 }
 
 const AtomString& AudioTrack::commentaryKeyword()
 {
-    static NeverDestroyed<AtomString> commentary("commentary", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> commentary("commentary", AtomString::ConstructFromLiteral);
     return commentary;
 }
 
index c65a118..d4e0f69 100644 (file)
@@ -52,37 +52,37 @@ WTF_MAKE_ISO_ALLOCATED_IMPL(TextTrack);
 
 const AtomString& TextTrack::subtitlesKeyword()
 {
-    static NeverDestroyed<const AtomString> subtitles("subtitles", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> subtitles("subtitles", AtomString::ConstructFromLiteral);
     return subtitles;
 }
 
 static const AtomString& captionsKeyword()
 {
-    static NeverDestroyed<const AtomString> captions("captions", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> captions("captions", AtomString::ConstructFromLiteral);
     return captions;
 }
 
 static const AtomString& descriptionsKeyword()
 {
-    static NeverDestroyed<const AtomString> descriptions("descriptions", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> descriptions("descriptions", AtomString::ConstructFromLiteral);
     return descriptions;
 }
 
 static const AtomString& chaptersKeyword()
 {
-    static NeverDestroyed<const AtomString> chapters("chapters", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> chapters("chapters", AtomString::ConstructFromLiteral);
     return chapters;
 }
 
 static const AtomString& metadataKeyword()
 {
-    static NeverDestroyed<const AtomString> metadata("metadata", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> metadata("metadata", AtomString::ConstructFromLiteral);
     return metadata;
 }
     
 static const AtomString& forcedKeyword()
 {
-    static NeverDestroyed<const AtomString> forced("forced", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> forced("forced", AtomString::ConstructFromLiteral);
     return forced;
 }
 
index 655108a..7dc8aa3 100644 (file)
@@ -64,19 +64,19 @@ WTF_MAKE_ISO_ALLOCATED_IMPL(TextTrackCueBox);
 
 const AtomString& TextTrackCue::cueShadowPseudoId()
 {
-    static NeverDestroyed<const AtomString> cue("cue", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> cue("cue", AtomString::ConstructFromLiteral);
     return cue;
 }
 
 const AtomString& TextTrackCue::cueBoxShadowPseudoId()
 {
-    static NeverDestroyed<const AtomString> trackDisplayBoxShadowPseudoId("-webkit-media-text-track-display", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> trackDisplayBoxShadowPseudoId("-webkit-media-text-track-display", AtomString::ConstructFromLiteral);
     return trackDisplayBoxShadowPseudoId;
 }
 
 const AtomString& TextTrackCue::cueBackdropShadowPseudoId()
 {
-    static NeverDestroyed<const AtomString> cueBackdropShadowPseudoId("-webkit-media-text-track-display-backdrop", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> cueBackdropShadowPseudoId("-webkit-media-text-track-display-backdrop", AtomString::ConstructFromLiteral);
     return cueBackdropShadowPseudoId;
 }
 
@@ -488,8 +488,7 @@ void TextTrackCue::rebuildDisplayTree()
     ScriptDisallowedScope::EventAllowedScope allowedScopeForReferenceTree(*m_cueNode);
 
     if (!m_displayTree) {
-        static NeverDestroyed<const AtomString> webkitGenericCueRootName("-webkit-generic-cue-root", AtomString::ConstructFromLiteral);
-        ASSERT(isMainThread());
+        static MainThreadNeverDestroyed<const AtomString> webkitGenericCueRootName("-webkit-generic-cue-root", AtomString::ConstructFromLiteral);
         m_displayTree = TextTrackCueBox::create(ownerDocument(), *this);
         m_displayTree->setPseudo(webkitGenericCueRootName);
     }
index 3a6e472..cd8c87b 100644 (file)
@@ -126,7 +126,7 @@ ExceptionOr<void> VTTRegion::setViewportAnchorY(double value)
 
 static const AtomString& upKeyword()
 {
-    static NeverDestroyed<const AtomString> upKeyword("up", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> upKeyword("up", AtomString::ConstructFromLiteral);
     return upKeyword;
 }
 
@@ -262,21 +262,21 @@ void VTTRegion::parseSettingValue(RegionSetting setting, VTTScanner& input)
 
 const AtomString& VTTRegion::textTrackCueContainerScrollingClass()
 {
-    static NeverDestroyed<const AtomString> trackRegionCueContainerScrollingClass("scrolling", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> trackRegionCueContainerScrollingClass("scrolling", AtomString::ConstructFromLiteral);
 
     return trackRegionCueContainerScrollingClass;
 }
 
 const AtomString& VTTRegion::textTrackCueContainerShadowPseudoId()
 {
-    static NeverDestroyed<const AtomString> trackRegionCueContainerPseudoId("-webkit-media-text-track-region-container", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> trackRegionCueContainerPseudoId("-webkit-media-text-track-region-container", AtomString::ConstructFromLiteral);
 
     return trackRegionCueContainerPseudoId;
 }
 
 const AtomString& VTTRegion::textTrackRegionShadowPseudoId()
 {
-    static NeverDestroyed<const AtomString> trackRegionShadowPseudoId("-webkit-media-text-track-region", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> trackRegionShadowPseudoId("-webkit-media-text-track-region", AtomString::ConstructFromLiteral);
 
     return trackRegionShadowPseudoId;
 }
index b5df183..38ed51c 100644 (file)
@@ -46,37 +46,37 @@ namespace WebCore {
 
 const AtomString& VideoTrack::alternativeKeyword()
 {
-    static NeverDestroyed<const AtomString> alternative("alternative", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> alternative("alternative", AtomString::ConstructFromLiteral);
     return alternative;
 }
 
 const AtomString& VideoTrack::captionsKeyword()
 {
-    static NeverDestroyed<const AtomString> captions("captions", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> captions("captions", AtomString::ConstructFromLiteral);
     return captions;
 }
 
 const AtomString& VideoTrack::mainKeyword()
 {
-    static NeverDestroyed<const AtomString> captions("main", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> captions("main", AtomString::ConstructFromLiteral);
     return captions;
 }
 
 const AtomString& VideoTrack::signKeyword()
 {
-    static NeverDestroyed<const AtomString> sign("sign", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> sign("sign", AtomString::ConstructFromLiteral);
     return sign;
 }
 
 const AtomString& VideoTrack::subtitlesKeyword()
 {
-    static NeverDestroyed<const AtomString> subtitles("subtitles", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> subtitles("subtitles", AtomString::ConstructFromLiteral);
     return subtitles;
 }
 
 const AtomString& VideoTrack::commentaryKeyword()
 {
-    static NeverDestroyed<const AtomString> commentary("commentary", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> commentary("commentary", AtomString::ConstructFromLiteral);
     return commentary;
 }
 
index e4a94a5..7508d75 100644 (file)
@@ -82,7 +82,7 @@ const AtomString& CachedResourceRequest::initiatorName() const
     if (!m_initiatorName.isEmpty())
         return m_initiatorName;
 
-    static NeverDestroyed<AtomString> defaultName("other", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> defaultName("other", AtomString::ConstructFromLiteral);
     return defaultName;
 }
 
index 9a84397..8d41717 100644 (file)
@@ -3406,10 +3406,10 @@ bool EventHandler::internalKeyEvent(const PlatformKeyboardEvent& initialKeyEvent
 
 static FocusDirection focusDirectionForKey(const AtomString& keyIdentifier)
 {
-    static NeverDestroyed<AtomString> Down("Down", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<AtomString> Up("Up", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<AtomString> Left("Left", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<AtomString> Right("Right", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> Down("Down", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> Up("Up", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> Left("Left", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> Right("Right", AtomString::ConstructFromLiteral);
 
     FocusDirection retVal = FocusDirectionNone;
 
index 2296a8f..e2a4c08 100644 (file)
@@ -684,7 +684,7 @@ bool Quirks::shouldBypassBackForwardCache() const
     // because it puts an overlay (with class "docs-homescreen-freeze-el-full") over the page when navigating away and fails
     // to remove it when coming back from the back/forward cache (e.g. in 'pageshow' event handler). See <rdar://problem/57670064>.
     // Note that this does not check for docs.google.com host because of hosted G Suite apps.
-    static NeverDestroyed<const AtomString> googleDocsOverlayDivClass("docs-homescreen-freeze-el-full", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> googleDocsOverlayDivClass("docs-homescreen-freeze-el-full", AtomString::ConstructFromLiteral);
     auto* firstChildInBody = m_document->body() ? m_document->body()->firstChild() : nullptr;
     if (is<HTMLDivElement>(firstChildInBody)) {
         auto& div = downcast<HTMLDivElement>(*firstChildInBody);
index ee0d568..93c49bc 100644 (file)
@@ -221,7 +221,7 @@ void CompositeAnimation::updateKeyframeAnimations(Element& element, const Render
     // Toss the animation order map.
     m_keyframeAnimationOrderMap.clear();
 
-    static NeverDestroyed<const AtomString> none("none", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> none("none", AtomString::ConstructFromLiteral);
     
     // Now mark any still active animations as active and add any new animations.
     if (targetStyle.animations()) {
index b149518..084f432 100644 (file)
@@ -403,7 +403,7 @@ const Vector<AtomString>& PlaybackSessionModelMediaElement::observedEventNames()
 
 const AtomString&  PlaybackSessionModelMediaElement::eventNameAll()
 {
-    static NeverDestroyed<AtomString> eventNameAll("allEvents", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> eventNameAll("allEvents", AtomString::ConstructFromLiteral);
     return eventNameAll;
 }
 
index e8e39c9..3ad69b7 100644 (file)
@@ -184,7 +184,7 @@ const Vector<AtomString>& VideoFullscreenModelVideoElement::observedEventNames()
 
 const AtomString& VideoFullscreenModelVideoElement::eventNameAll()
 {
-    static NeverDestroyed<AtomString> sEventNameAll = "allEvents";
+    static MainThreadNeverDestroyed<const AtomString> sEventNameAll = "allEvents";
     return sEventNameAll;
 }
 
index 7fcaa44..aba1a84 100644 (file)
@@ -149,12 +149,12 @@ static FontPlatformDataCache& fontPlatformDataCache()
 
 const AtomString& FontCache::alternateFamilyName(const AtomString& familyName)
 {
-    static NeverDestroyed<AtomString> arial("Arial", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<AtomString> courier("Courier", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<AtomString> courierNew("Courier New", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<AtomString> helvetica("Helvetica", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<AtomString> times("Times", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<AtomString> timesNewRoman("Times New Roman", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> arial("Arial", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> courier("Courier", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> courierNew("Courier New", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> helvetica("Helvetica", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> times("Times", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> timesNewRoman("Times New Roman", AtomString::ConstructFromLiteral);
 
     const AtomString& platformSpecificAlternate = platformAlternateFamilyName(familyName);
     if (!platformSpecificAlternate.isNull())
index c828bbe..5c2aaf8 100644 (file)
@@ -297,13 +297,13 @@ static void addMediaEngine(std::unique_ptr<MediaPlayerFactory>&& factory)
 
 static const AtomString& applicationOctetStream()
 {
-    static NeverDestroyed<const AtomString> applicationOctetStream("application/octet-stream", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> applicationOctetStream("application/octet-stream", AtomString::ConstructFromLiteral);
     return applicationOctetStream;
 }
 
 static const AtomString& textPlain()
 {
-    static NeverDestroyed<const AtomString> textPlain("text/plain", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> textPlain("text/plain", AtomString::ConstructFromLiteral);
     return textPlain;
 }
 
index 2d6e9aa..8ac48ec 100644 (file)
@@ -75,13 +75,13 @@ const Vector<FourCC>& CDMPrivateFairPlayStreaming::validFairPlayStreamingSchemes
 
 const AtomString& CDMPrivateFairPlayStreaming::sinfName()
 {
-    static NeverDestroyed<AtomString> sinf { MAKE_STATIC_STRING_IMPL("sinf") };
+    static MainThreadNeverDestroyed<const AtomString> sinf { MAKE_STATIC_STRING_IMPL("sinf") };
     return sinf;
 }
 
 const AtomString& CDMPrivateFairPlayStreaming::skdName()
 {
-    static NeverDestroyed<AtomString> skd { MAKE_STATIC_STRING_IMPL("skd") };
+    static MainThreadNeverDestroyed<const AtomString> skd { MAKE_STATIC_STRING_IMPL("skd") };
     return skd;
 }
 
index 99a93c2..3b80428 100644 (file)
@@ -3018,12 +3018,12 @@ void MediaPlayerPrivateAVFoundationObjC::setBufferingPolicy(MediaPlayer::Bufferi
 #if ENABLE(DATACUE_VALUE)
 static const AtomString& metadataType(NSString *avMetadataKeySpace)
 {
-    static NeverDestroyed<const AtomString> quickTimeUserData("com.apple.quicktime.udta", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<const AtomString> isoUserData("org.mp4ra", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<const AtomString> quickTimeMetadata("com.apple.quicktime.mdta", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<const AtomString> iTunesMetadata("com.apple.itunes", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<const AtomString> id3Metadata("org.id3", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<const AtomString> hlsDateRangeMetadata("com.apple.quicktime.HLS", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> quickTimeUserData("com.apple.quicktime.udta", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> isoUserData("org.mp4ra", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> quickTimeMetadata("com.apple.quicktime.mdta", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> iTunesMetadata("com.apple.itunes", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> id3Metadata("org.id3", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> hlsDateRangeMetadata("com.apple.quicktime.HLS", AtomString::ConstructFromLiteral);
 
     if ([avMetadataKeySpace isEqualToString:AVMetadataKeySpaceQuickTimeUserData])
         return quickTimeUserData;
index f628ac2..332d2ef 100644 (file)
@@ -705,13 +705,13 @@ RefPtr<Font> FontCache::similarFont(const FontDescription& description, const At
 #if PLATFORM(IOS_FAMILY)
     // Substitute the default monospace font for well-known monospace fonts.
     if (equalLettersIgnoringASCIICase(family, "monaco") || equalLettersIgnoringASCIICase(family, "menlo")) {
-        static NeverDestroyed<AtomString> courier("courier", AtomString::ConstructFromLiteral);
+        static MainThreadNeverDestroyed<const AtomString> courier("courier", AtomString::ConstructFromLiteral);
         return fontForFamily(description, courier);
     }
 
     // Substitute Verdana for Lucida Grande.
     if (equalLettersIgnoringASCIICase(family, "lucida grande")) {
-        static NeverDestroyed<AtomString> verdana("verdana", AtomString::ConstructFromLiteral);
+        static MainThreadNeverDestroyed<const AtomString> verdana("verdana", AtomString::ConstructFromLiteral);
         return fontForFamily(description, verdana);
     }
 #endif
@@ -720,8 +720,8 @@ RefPtr<Font> FontCache::similarFont(const FontDescription& description, const At
     static NeverDestroyed<String> pashto(MAKE_STATIC_STRING_IMPL("Pashto"));
     static NeverDestroyed<String> urdu(MAKE_STATIC_STRING_IMPL("Urdu"));
     static String* matchWords[3] = { &arabic.get(), &pashto.get(), &urdu.get() };
-    static NeverDestroyed<AtomString> geezaPlain("GeezaPro", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<AtomString> geezaBold("GeezaPro-Bold", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> geezaPlain("GeezaPro", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> geezaBold("GeezaPro-Bold", AtomString::ConstructFromLiteral);
     for (String* matchWord : matchWords) {
         if (family.containsIgnoringASCIICase(*matchWord))
             return fontForFamily(description, isFontWeightBold(description.weight()) ? geezaBold : geezaPlain);
@@ -1507,10 +1507,10 @@ const AtomString& FontCache::platformAlternateFamilyName(const AtomString& famil
     static const UChar weiruanYaHeiString[] = { 0x5fae, 0x8f6f, 0x96c5, 0x9ed1 };
     static const UChar weiruanZhengHeitiString[] = { 0x5fae, 0x8edf, 0x6b63, 0x9ed1, 0x9ad4 };
 
-    static NeverDestroyed<AtomString> songtiSC("Songti SC", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<AtomString> songtiTC("Songti TC", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<AtomString> heitiSCReplacement("PingFang SC", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<AtomString> heitiTCReplacement("PingFang TC", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> songtiSC("Songti SC", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> songtiTC("Songti TC", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> heitiSCReplacement("PingFang SC", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> heitiTCReplacement("PingFang TC", AtomString::ConstructFromLiteral);
 
     switch (familyName.length()) {
     case 2:
index cc4e2bc..350b16a 100644 (file)
@@ -213,22 +213,22 @@ SystemFontDatabaseCoreText::CascadeListParameters SystemFontDatabaseCoreText::sy
 
     switch (systemFontKind) {
     case SystemFontKind::SystemUI: {
-        static NeverDestroyed<AtomString> systemUI = AtomString("system-ui", AtomString::ConstructFromLiteral);
+        static MainThreadNeverDestroyed<const AtomString> systemUI = AtomString("system-ui", AtomString::ConstructFromLiteral);
         result.fontName = systemUI.get();
         break;
     }
     case SystemFontKind::UISerif: {
-        static NeverDestroyed<AtomString> systemUISerif = AtomString("ui-serif", AtomString::ConstructFromLiteral);
+        static MainThreadNeverDestroyed<const AtomString> systemUISerif = AtomString("ui-serif", AtomString::ConstructFromLiteral);
         result.fontName = systemUISerif.get();
         break;
     }
     case SystemFontKind::UIMonospace: {
-        static NeverDestroyed<AtomString> systemUIMonospace = AtomString("ui-monospace", AtomString::ConstructFromLiteral);
+        static MainThreadNeverDestroyed<const AtomString> systemUIMonospace = AtomString("ui-monospace", AtomString::ConstructFromLiteral);
         result.fontName = systemUIMonospace.get();
         break;
     }
     case SystemFontKind::UIRounded: {
-        static NeverDestroyed<AtomString> systemUIRounded = AtomString("ui-rounded", AtomString::ConstructFromLiteral);
+        static MainThreadNeverDestroyed<const AtomString> systemUIRounded = AtomString("ui-rounded", AtomString::ConstructFromLiteral);
         result.fontName = systemUIRounded.get();
         break;
     }
index a0aa250..ef69521 100644 (file)
@@ -37,7 +37,7 @@ Ref<SourceAlpha> SourceAlpha::create(FilterEffect& sourceEffect)
 
 const AtomString& SourceAlpha::effectName()
 {
-    static NeverDestroyed<const AtomString> s_effectName("SourceAlpha", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> s_effectName("SourceAlpha", AtomString::ConstructFromLiteral);
     return s_effectName;
 }
 
index 045ee01..88a36a4 100644 (file)
@@ -36,7 +36,7 @@ Ref<SourceGraphic> SourceGraphic::create(Filter& filter)
 
 const AtomString& SourceGraphic::effectName()
 {
-    static NeverDestroyed<const AtomString> s_effectName("SourceGraphic", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> s_effectName("SourceGraphic", AtomString::ConstructFromLiteral);
     return s_effectName;
 }
 
index 4f08ca0..2b2ac8a 100644 (file)
@@ -53,10 +53,10 @@ FontPlatformData* FontCache::getCustomFallbackFont(const UInt32 c, const FontDes
 {
     ASSERT(requiresCustomFallbackFont(c));
 
-    static NeverDestroyed<AtomString> helveticaFamily("Helvetica Neue", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<AtomString> timesNewRomanPSMTFamily("TimesNewRomanPSMT", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> helveticaFamily("Helvetica Neue", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> timesNewRomanPSMTFamily("TimesNewRomanPSMT", AtomString::ConstructFromLiteral);
 
-    AtomString* family = nullptr;
+    const AtomString* family = nullptr;
     switch (c) {
     case AppleLogo:
         family = &helveticaFamily.get();
index 17cb50e..0989980 100644 (file)
@@ -34,7 +34,7 @@ namespace WebCore {
 
 #define TEXMAP_DECLARE_VARIABLE(Accessor, Name, Type) \
     GLuint Accessor##Location() { \
-        static NeverDestroyed<const AtomString> name(Name, AtomString::ConstructFromLiteral); \
+        static MainThreadNeverDestroyed<const AtomString> name(Name, AtomString::ConstructFromLiteral); \
         return getLocation(name.get(), Type); \
     }
 
index 68d48e8..2b4b557 100644 (file)
@@ -373,7 +373,7 @@ RefPtr<Font> FontCache::fontFromDescriptionAndLogFont(const FontDescription& fon
 
 Ref<Font> FontCache::lastResortFallbackFont(const FontDescription& fontDescription)
 {
-    static NeverDestroyed<AtomString> fallbackFontName;
+    static MainThreadNeverDestroyed<AtomString> fallbackFontName;
 
     if (!fallbackFontName.get().isEmpty())
         return *fontForFamily(fontDescription, fallbackFontName);
@@ -384,7 +384,7 @@ Ref<Font> FontCache::lastResortFallbackFont(const FontDescription& fontDescripti
     // Search all typical Windows-installed full Unicode fonts.
     // Sorted by most to least glyphs according to http://en.wikipedia.org/wiki/Unicode_typefaces
     // Start with Times New Roman also since it is the default if the user doesn't change prefs.
-    static NeverDestroyed<AtomString> fallbackFonts[] = {
+    static MainThreadNeverDestroyed<const AtomString> fallbackFonts[] = {
         AtomString("Times New Roman", AtomString::ConstructFromLiteral),
         AtomString("Microsoft Sans Serif", AtomString::ConstructFromLiteral),
         AtomString("Tahoma", AtomString::ConstructFromLiteral),
@@ -694,8 +694,8 @@ std::unique_ptr<FontPlatformData> FontCache::createFontPlatformData(const FontDe
 
 const AtomString& FontCache::platformAlternateFamilyName(const AtomString& familyName)
 {
-    static NeverDestroyed<AtomString> timesNewRoman("Times New Roman", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<AtomString> microsoftSansSerif("Microsoft Sans Serif", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> timesNewRoman("Times New Roman", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> microsoftSansSerif("Microsoft Sans Serif", AtomString::ConstructFromLiteral);
 
     switch (familyName.length()) {
     // On Windows, we don't support bitmap fonts, but legacy content expects support.
index 85aa1e1..b8b057b 100644 (file)
@@ -150,7 +150,7 @@ static inline AtomString extractHTTPStatusText(CFHTTPMessageRef messageRef)
     if (auto httpStatusLine = adoptCF(CFHTTPMessageCopyResponseStatusLine(messageRef)))
         return extractReasonPhraseFromHTTPStatusLine(httpStatusLine.get());
 
-    static NeverDestroyed<AtomString> defaultStatusText("OK", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> defaultStatusText("OK", AtomString::ConstructFromLiteral);
     return defaultStatusText;
 }
 
index 29ebe56..41bb52f 100644 (file)
@@ -2158,7 +2158,7 @@ void ComplexLineLayout::checkLinesForTextOverflow()
     // Determine the width of the ellipsis using the current font.
     // FIXME: CSS3 says this is configurable, also need to use 0x002E (FULL STOP) if horizontal ellipsis is "not renderable"
     const FontCascade& font = style().fontCascade();
-    static NeverDestroyed<AtomString> ellipsisStr(&horizontalEllipsis, 1);
+    static MainThreadNeverDestroyed<const AtomString> ellipsisStr(&horizontalEllipsis, 1);
     const FontCascade& firstLineFont = m_flow.firstLineStyle().fontCascade();
     float firstLineEllipsisWidth = firstLineFont.width(m_flow.constructTextRun(&horizontalEllipsis, 1, m_flow.firstLineStyle()));
     float ellipsisWidth = (font == firstLineFont) ? firstLineEllipsisWidth : font.width(m_flow.constructTextRun(&horizontalEllipsis, 1, style()));
index 8150f55..9703be4 100644 (file)
@@ -991,8 +991,8 @@ void RenderDeprecatedFlexibleBox::applyLineClamp(FlexBoxIterator& iterator, bool
             continue;
 
         const UChar ellipsisAndSpace[2] = { horizontalEllipsis, ' ' };
-        static NeverDestroyed<AtomString> ellipsisAndSpaceStr(ellipsisAndSpace, 2);
-        static NeverDestroyed<AtomString> ellipsisStr(&horizontalEllipsis, 1);
+        static MainThreadNeverDestroyed<const AtomString> ellipsisAndSpaceStr(ellipsisAndSpace, 2);
+        static MainThreadNeverDestroyed<const AtomString> ellipsisStr(&horizontalEllipsis, 1);
         const RenderStyle& lineStyle = numVisibleLines == 1 ? firstLineStyle() : style();
         const FontCascade& font = lineStyle.fontCascade();
 
index 1d7f031..bd0b90e 100644 (file)
@@ -1566,8 +1566,8 @@ const AtomString& RenderStyle::hyphenString() const
         return hyphenationString;
 
     // FIXME: This should depend on locale.
-    static NeverDestroyed<AtomString> hyphenMinusString(&hyphenMinus, 1);
-    static NeverDestroyed<AtomString> hyphenString(&hyphen, 1);
+    static MainThreadNeverDestroyed<const AtomString> hyphenMinusString(&hyphenMinus, 1);
+    static MainThreadNeverDestroyed<const AtomString> hyphenString(&hyphen, 1);
     return fontCascade().primaryFont().glyphForCharacter(hyphen) ? hyphenString : hyphenMinusString;
 }
 
@@ -1579,28 +1579,28 @@ const AtomString& RenderStyle::textEmphasisMarkString() const
     case TextEmphasisMark::Custom:
         return textEmphasisCustomMark();
     case TextEmphasisMark::Dot: {
-        static NeverDestroyed<AtomString> filledDotString(&bullet, 1);
-        static NeverDestroyed<AtomString> openDotString(&whiteBullet, 1);
+        static MainThreadNeverDestroyed<const AtomString> filledDotString(&bullet, 1);
+        static MainThreadNeverDestroyed<const AtomString> openDotString(&whiteBullet, 1);
         return textEmphasisFill() == TextEmphasisFill::Filled ? filledDotString : openDotString;
     }
     case TextEmphasisMark::Circle: {
-        static NeverDestroyed<AtomString> filledCircleString(&blackCircle, 1);
-        static NeverDestroyed<AtomString> openCircleString(&whiteCircle, 1);
+        static MainThreadNeverDestroyed<const AtomString> filledCircleString(&blackCircle, 1);
+        static MainThreadNeverDestroyed<const AtomString> openCircleString(&whiteCircle, 1);
         return textEmphasisFill() == TextEmphasisFill::Filled ? filledCircleString : openCircleString;
     }
     case TextEmphasisMark::DoubleCircle: {
-        static NeverDestroyed<AtomString> filledDoubleCircleString(&fisheye, 1);
-        static NeverDestroyed<AtomString> openDoubleCircleString(&bullseye, 1);
+        static MainThreadNeverDestroyed<const AtomString> filledDoubleCircleString(&fisheye, 1);
+        static MainThreadNeverDestroyed<const AtomString> openDoubleCircleString(&bullseye, 1);
         return textEmphasisFill() == TextEmphasisFill::Filled ? filledDoubleCircleString : openDoubleCircleString;
     }
     case TextEmphasisMark::Triangle: {
-        static NeverDestroyed<AtomString> filledTriangleString(&blackUpPointingTriangle, 1);
-        static NeverDestroyed<AtomString> openTriangleString(&whiteUpPointingTriangle, 1);
+        static MainThreadNeverDestroyed<const AtomString> filledTriangleString(&blackUpPointingTriangle, 1);
+        static MainThreadNeverDestroyed<const AtomString> openTriangleString(&whiteUpPointingTriangle, 1);
         return textEmphasisFill() == TextEmphasisFill::Filled ? filledTriangleString : openTriangleString;
     }
     case TextEmphasisMark::Sesame: {
-        static NeverDestroyed<AtomString> filledSesameString(&sesameDot, 1);
-        static NeverDestroyed<AtomString> openSesameString(&whiteSesameDot, 1);
+        static MainThreadNeverDestroyed<const AtomString> filledSesameString(&sesameDot, 1);
+        static MainThreadNeverDestroyed<const AtomString> openSesameString(&whiteSesameDot, 1);
         return textEmphasisFill() == TextEmphasisFill::Filled ? filledSesameString : openSesameString;
     }
     case TextEmphasisMark::Auto:
index 221ee65..fccf2ba 100644 (file)
@@ -545,20 +545,20 @@ void Adjuster::adjustForSiteSpecificQuirks(RenderStyle& style) const
 
     if (m_document.quirks().needsGMailOverflowScrollQuirk()) {
         // This turns sidebar scrollable without mouse move event.
-        static NeverDestroyed<AtomString> roleValue("navigation", AtomString::ConstructFromLiteral);
+        static MainThreadNeverDestroyed<const AtomString> roleValue("navigation", AtomString::ConstructFromLiteral);
         if (style.overflowY() == Overflow::Hidden && m_element->attributeWithoutSynchronization(roleAttr) == roleValue)
             style.setOverflowY(Overflow::Auto);
     }
     if (m_document.quirks().needsYouTubeOverflowScrollQuirk()) {
         // This turns sidebar scrollable without hover.
-        static NeverDestroyed<AtomString> idValue("guide-inner-content", AtomString::ConstructFromLiteral);
+        static MainThreadNeverDestroyed<const AtomString> idValue("guide-inner-content", AtomString::ConstructFromLiteral);
         if (style.overflowY() == Overflow::Hidden && m_element->idForStyleResolution() == idValue)
             style.setOverflowY(Overflow::Auto);
     }
     if (m_document.quirks().needsFullscreenDisplayNoneQuirk()) {
         if (is<HTMLDivElement>(m_element) && style.display() == DisplayType::None) {
-            static NeverDestroyed<const AtomString> instreamNativeVideoDivClass("instream-native-video--mobile", AtomString::ConstructFromLiteral);
-            static NeverDestroyed<const AtomString> videoElementID("vjs_video_3_html5_api", AtomString::ConstructFromLiteral);
+            static MainThreadNeverDestroyed<const AtomString> instreamNativeVideoDivClass("instream-native-video--mobile", AtomString::ConstructFromLiteral);
+            static MainThreadNeverDestroyed<const AtomString> videoElementID("vjs_video_3_html5_api", AtomString::ConstructFromLiteral);
 
             auto& div = downcast<HTMLDivElement>(*m_element);
             if (div.hasClass() && div.classNames().contains(instreamNativeVideoDivClass)) {
index 5d05211..25458c4 100644 (file)
@@ -109,8 +109,8 @@ void SVGAnimateMotionElement::parseAttribute(const QualifiedName& name, const At
     
 SVGAnimateMotionElement::RotateMode SVGAnimateMotionElement::rotateMode() const
 {
-    static NeverDestroyed<const AtomString> autoVal("auto", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<const AtomString> autoReverse("auto-reverse", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> autoVal("auto", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> autoReverse("auto-reverse", AtomString::ConstructFromLiteral);
     const AtomString& rotate = getAttribute(SVGNames::rotateAttr);
     if (rotate == autoVal)
         return RotateAuto;
index 1b461b4..45e45d5 100644 (file)
@@ -276,10 +276,10 @@ void SVGAnimationElement::updateAnimationMode()
 
 void SVGAnimationElement::setCalcMode(const AtomString& calcMode)
 {
-    static NeverDestroyed<const AtomString> discrete("discrete", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<const AtomString> linear("linear", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<const AtomString> paced("paced", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<const AtomString> spline("spline", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> discrete("discrete", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> linear("linear", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> paced("paced", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> spline("spline", AtomString::ConstructFromLiteral);
     if (calcMode == discrete)
         setCalcMode(CalcMode::Discrete);
     else if (calcMode == linear)
@@ -294,8 +294,8 @@ void SVGAnimationElement::setCalcMode(const AtomString& calcMode)
 
 void SVGAnimationElement::setAttributeType(const AtomString& attributeType)
 {
-    static NeverDestroyed<const AtomString> css("CSS", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<const AtomString> xml("XML", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> css("CSS", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> xml("XML", AtomString::ConstructFromLiteral);
     if (attributeType == css)
         m_attributeType = AttributeType::CSS;
     else if (attributeType == xml)
@@ -321,14 +321,14 @@ String SVGAnimationElement::fromValue() const
 
 bool SVGAnimationElement::isAdditive() const
 {
-    static NeverDestroyed<const AtomString> sum("sum", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> sum("sum", AtomString::ConstructFromLiteral);
     const AtomString& value = attributeWithoutSynchronization(SVGNames::additiveAttr);
     return value == sum || animationMode() == AnimationMode::By;
 }
 
 bool SVGAnimationElement::isAccumulated() const
 {
-    static NeverDestroyed<const AtomString> sum("sum", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> sum("sum", AtomString::ConstructFromLiteral);
     const AtomString& value = attributeWithoutSynchronization(SVGNames::accumulateAttr);
     return value == sum && animationMode() != AnimationMode::To;
 }
@@ -606,7 +606,7 @@ void SVGAnimationElement::computeCSSPropertyValue(SVGElement* element, CSSProper
 
 static bool inheritsFromProperty(SVGElement* targetElement, const QualifiedName& attributeName, const String& value)
 {
-    static NeverDestroyed<const AtomString> inherit("inherit", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> inherit("inherit", AtomString::ConstructFromLiteral);
     
     if (value.isEmpty() || value != inherit)
         return false;
index 6ce75ee..25b82a2 100644 (file)
@@ -64,7 +64,7 @@ void SVGStyleElement::setDisabled(bool setDisabled)
 
 const AtomString& SVGStyleElement::type() const
 {
-    static NeverDestroyed<const AtomString> defaultValue("text/css", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> defaultValue("text/css", AtomString::ConstructFromLiteral);
     const AtomString& n = getAttribute(SVGNames::typeAttr);
     return n.isNull() ? defaultValue.get() : n;
 }
@@ -76,7 +76,7 @@ void SVGStyleElement::setType(const AtomString& type)
 
 const AtomString& SVGStyleElement::media() const
 {
-    static NeverDestroyed<const AtomString> defaultValue("all", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> defaultValue("all", AtomString::ConstructFromLiteral);
     const AtomString& n = attributeWithoutSynchronization(SVGNames::mediaAttr);
     return n.isNull() ? defaultValue.get() : n;
 }
index 449b14c..0432128 100644 (file)
@@ -340,7 +340,7 @@ SMILTime SVGSMILElement::parseClockValue(const String& data)
     
     String parse = data.stripWhiteSpace();
 
-    static NeverDestroyed<const AtomString> indefiniteValue("indefinite", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> indefiniteValue("indefinite", AtomString::ConstructFromLiteral);
     if (parse == indefiniteValue)
         return SMILTime::indefinite();
 
@@ -652,8 +652,8 @@ bool SVGSMILElement::isFrozen() const
     
 SVGSMILElement::Restart SVGSMILElement::restart() const
 {    
-    static NeverDestroyed<const AtomString> never("never", AtomString::ConstructFromLiteral);
-    static NeverDestroyed<const AtomString> whenNotActive("whenNotActive", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> never("never", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> whenNotActive("whenNotActive", AtomString::ConstructFromLiteral);
     const AtomString& value = attributeWithoutSynchronization(SVGNames::restartAttr);
     if (value == never)
         return RestartNever;
@@ -664,7 +664,7 @@ SVGSMILElement::Restart SVGSMILElement::restart() const
     
 SVGSMILElement::FillMode SVGSMILElement::fill() const
 {   
-    static NeverDestroyed<const AtomString> freeze("freeze", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> freeze("freeze", AtomString::ConstructFromLiteral);
     const AtomString& value = attributeWithoutSynchronization(SVGNames::fillAttr);
     return value == freeze ? FillFreeze : FillRemove;
 }
@@ -697,7 +697,7 @@ SMILTime SVGSMILElement::repeatCount() const
     if (value.isNull())
         return SMILTime::unresolved();
 
-    static NeverDestroyed<const AtomString> indefiniteValue("indefinite", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> indefiniteValue("indefinite", AtomString::ConstructFromLiteral);
     if (value == indefiniteValue)
         return SMILTime::indefinite();
     bool ok;
index 72b25b5..476fb34 100644 (file)
@@ -33,7 +33,7 @@ namespace WebCore {
 
 Color SVGAnimationColorFunction::colorFromString(SVGElement* targetElement, const String& string)
 {
-    static NeverDestroyed<const AtomString> currentColor("currentColor", AtomString::ConstructFromLiteral);
+    static MainThreadNeverDestroyed<const AtomString> currentColor("currentColor", AtomString::ConstructFromLiteral);
 
     if (string != currentColor.get())
         return SVGPropertyTraits<Color>::fromString(string);
index 21e883f..d8e8ec1 100644 (file)
@@ -72,7 +72,7 @@ protected:
 
     String adjustForInheritance(SVGElement* targetElement, const String& value) const
     {
-        static NeverDestroyed<const AtomString> inherit("inherit", AtomString::ConstructFromLiteral);
+        static MainThreadNeverDestroyed<const AtomString> inherit("inherit", AtomString::ConstructFromLiteral);
         return value == inherit ? computeInheritedCSSPropertyValue(targetElement) : value;
     }