Bug 130256

Summary: AX: Replace DEPRECATED_DEFINE_STATIC_LOCAL by static NeverDestroyed<T>
Product: WebKit Reporter: Sergio Villar Senin <svillar>
Component: New BugsAssignee: Sergio Villar Senin <svillar>
Status: RESOLVED WORKSFORME    
Severity: Normal CC: aboxhall, apinheiro, bfulgham, cfleizach, commit-queue, darin, dmazzoni, eric.carlson, glenn, jcraig, jdiggs, jer.noble, mario, philipj, samuel_white, sergio
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 130185    
Attachments:
Description Flags
Patch none

Sergio Villar Senin
Reported 2014-03-14 12:42:28 PDT
AX: Replace DEPRECATED_DEFINE_STATIC_LOCAL by static NeverDestroyed<T>
Attachments
Patch (18.11 KB, patch)
2014-03-14 12:43 PDT, Sergio Villar Senin
no flags
Sergio Villar Senin
Comment 1 2014-03-14 12:43:10 PDT
James Craig
Comment 2 2014-03-14 13:02:03 PDT
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.
Anders Carlsson
Comment 3 2014-03-14 13:12:31 PDT
Comment on attachment 226751 [details] Patch I don't think we should be using NeverDestroyed for Strings, and definitely not AtomicStrings.
Sergio Villar Senin
Comment 4 2014-03-17 09:09:46 PDT
(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?
Sergio Villar Senin
Comment 5 2014-03-17 09:38:23 PDT
(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.
Brent Fulgham
Comment 6 2014-04-01 10:17:43 PDT
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!
Darin Adler
Comment 7 2014-04-01 13:54:44 PDT
(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.
Sergio Villar Senin
Comment 8 2014-05-06 09:34:03 PDT
This was overruled by an exact same bug reported later but that landed before
Csaba Osztrogonác
Comment 9 2014-06-04 00:51:40 PDT
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).
Note You need to log in before you can comment on or make changes to this bug.