AX: Replace DEPRECATED_DEFINE_STATIC_LOCAL by static NeverDestroyed<T>
Created attachment 226751 [details] Patch
Comment on attachment 226751 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=226751&action=review > Source/WebCore/accessibility/AccessibilityObject.cpp:1535 > - DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, invalidStatusFalse, ("false", AtomicString::ConstructFromLiteral)); > - DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, invalidStatusTrue, ("true", AtomicString::ConstructFromLiteral)); > + static NeverDestroyed<const AtomicString> invalidStatusFalse("false", AtomicString::ConstructFromLiteral); > + static NeverDestroyed<const AtomicString> invalidStatusTrue("true", AtomicString::ConstructFromLiteral); Please remove the invalidStatus changes from this patch. It's being handled in bug 130071 and your patch will cause conflicts.
Comment on attachment 226751 [details] Patch I don't think we should be using NeverDestroyed for Strings, and definitely not AtomicStrings.
(In reply to comment #3) > (From update of attachment 226751 [details]) > I don't think we should be using NeverDestroyed for Strings, and definitely not AtomicStrings. Should we leave them as they are then?
(In reply to comment #3) > (From update of attachment 226751 [details]) > I don't think we should be using NeverDestroyed for Strings, and definitely not AtomicStrings. BTW I changed them also because I saw a similar usage in many different places, from platform/ to html/. Maybe we should fix those too.
It's also confusing that we now have a DEPRECATED_DEFINE_STATIC_LOCAL macro, if we should still be using it for AtomicStrings. I think we need some Style Guide guidance on this!
(In reply to comment #6) > It's also confusing that we now have a DEPRECATED_DEFINE_STATIC_LOCAL macro, if we should still be using it for AtomicStrings. We should not be using DEPRECATED_DEFINE_STATIC_LOCAL at all, definitely not for AtomicString. It can always be replaced by NeverDestroyed. But, as a separate related issue, Anders thinks that we are overusing static locals for AtomicString, and thinks we should cut down on this overuse during the process of converting from DEPRECATED_DEFINE_STATIC_LOCAL to NeverDestroyed, by not converting some and instead making them not use a static local AtomicString at all.
This was overruled by an exact same bug reported later but that landed before
Comment on attachment 226751 [details] Patch Cleared review? from attachment 226751 [details] so that this bug does not appear in http://webkit.org/pending-review. If you would like this patch reviewed, please attach it to a new bug (or re-open this bug before marking it for review again).