Bug 130409

Summary: Replace DEPRECATED_DEFINE_STATIC_LOCAL by static NeverDestroyed<T> in css
Product: WebKit Reporter: Sergio Villar Senin <svillar>
Component: CSSAssignee: Sergio Villar Senin <svillar>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, commit-queue, darin, esprehn+autocc, glenn, gyuyoung.kim, hyatt, kling, macpherson, menard, ossy, simon.fraser, svillar
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 130185    
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Another try
none
Patch darin: review+

Description Sergio Villar Senin 2014-03-18 11:44:58 PDT
CSS: use static NeverDestroyed<T> instead of DEPRECATED_DEFINE_STATIC_LOCAL
Comment 1 Sergio Villar Senin 2014-03-18 11:49:10 PDT
Created attachment 227083 [details]
Patch
Comment 2 Darin Adler 2014-03-19 18:29:32 PDT
Comment on attachment 227083 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=227083&action=review

> Source/WebCore/css/CSSValuePool.cpp:41
>  CSSValuePool& cssValuePool()
>  {
> -    DEPRECATED_DEFINE_STATIC_LOCAL(CSSValuePool, pool, ());
> +    static NeverDestroyed<CSSValuePool> pool;
>      return pool;
>  }

You’ll need to change the friend directive for this function.
Comment 3 Sergio Villar Senin 2014-03-20 02:08:12 PDT
Created attachment 227275 [details]
Patch

Yeah stupid mistake, added it in 2 classes
Comment 4 Darin Adler 2014-03-20 09:05:20 PDT
Comment on attachment 227275 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=227275&action=review

> Source/WebCore/css/CSSValuePool.h:44
> +    friend class NeverDestroyed<CSSValuePool>;

Seems like this did not work on Windows.
Comment 5 Sergio Villar Senin 2014-03-20 10:39:23 PDT
Comment on attachment 227275 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=227275&action=review

>> Source/WebCore/css/CSSValuePool.h:44
>> +    friend class NeverDestroyed<CSSValuePool>;
> 
> Seems like this did not work on Windows.

Weird because it worked fine for the other platforms, maybe defining it after the WTF_MAKE_FAST_ALLOCATED?
Comment 6 Sergio Villar Senin 2014-03-20 11:46:17 PDT
Created attachment 227309 [details]
Patch
Comment 7 Sergio Villar Senin 2014-03-21 03:09:16 PDT
Created attachment 227407 [details]
Another try
Comment 8 Sergio Villar Senin 2014-03-21 08:35:08 PDT
Perhaps Brent has an idea about what's going on here...
Comment 9 Brent Fulgham 2014-03-28 09:41:28 PDT
I just tried it on my Windows machine. If you use “friend class WTF::NeverDestroyed<blah blah>;” it should compile properly.
Comment 10 Sergio Villar Senin 2014-03-28 10:12:48 PDT
Created attachment 228062 [details]
Patch

Windows fix. We need WTF:: in the friend class declaration
Comment 11 Sergio Villar Senin 2014-03-31 01:36:02 PDT
Committed r166486: <http://trac.webkit.org/changeset/166486>