Changeset 165641 in webkit


Ignore:
Timestamp:
Mar 14, 2014 1:33:44 PM (10 years ago)
Author:
fred.wang@free.fr
Message:

FontCache: Replace DEPRECATED_DEFINE_STATIC_LOCAL with static NeverDestroyed<T>.
https://bugs.webkit.org/show_bug.cgi?id=130233

Reviewed by Andreas Kling.

No new tests.

  • platform/graphics/FontCache.cpp:

(WebCore::fontCache):
(WebCore::FontVerticalDataCacheKeyTraits::emptyValue):
(WebCore::fontVerticalDataCacheInstance):
(WebCore::FontDataCacheKeyTraits::emptyValue):

  • platform/graphics/FontCache.h:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r165640 r165641  
     12014-03-14  Frédéric Wang  <fred.wang@free.fr>
     2
     3        FontCache: Replace DEPRECATED_DEFINE_STATIC_LOCAL with static NeverDestroyed<T>.
     4        https://bugs.webkit.org/show_bug.cgi?id=130233
     5
     6        Reviewed by Andreas Kling.
     7
     8        No new tests.
     9
     10        * platform/graphics/FontCache.cpp:
     11        (WebCore::fontCache):
     12        (WebCore::FontVerticalDataCacheKeyTraits::emptyValue):
     13        (WebCore::fontVerticalDataCacheInstance):
     14        (WebCore::FontDataCacheKeyTraits::emptyValue):
     15        * platform/graphics/FontCache.h:
     16
    1172014-03-11  Oliver Hunt  <oliver@apple.com>
    218
  • trunk/Source/WebCore/platform/graphics/FontCache.cpp

    r165607 r165641  
    3838#include <wtf/HashMap.h>
    3939#include <wtf/ListHashSet.h>
     40#include <wtf/NeverDestroyed.h>
    4041#include <wtf/StdLibExtras.h>
    4142#include <wtf/text/AtomicStringHash.h>
     
    8889FontCache* fontCache()
    8990{
    90     DEPRECATED_DEFINE_STATIC_LOCAL(FontCache, globalFontCache, ());
    91     return &globalFontCache;
     91    static NeverDestroyed<FontCache> globalFontCache;
     92    return &globalFontCache.get();
    9293}
    9394
     
    286287    static const FontCache::FontFileKey& emptyValue()
    287288    {
    288         DEPRECATED_DEFINE_STATIC_LOCAL(FontCache::FontFileKey, key, (nullAtom));
     289        static NeverDestroyed<FontCache::FontFileKey> key = nullAtom;
    289290        return key;
    290291    }
     
    303304FontVerticalDataCache& fontVerticalDataCacheInstance()
    304305{
    305     DEPRECATED_DEFINE_STATIC_LOCAL(FontVerticalDataCache, fontVerticalDataCache, ());
     306    static NeverDestroyed<FontVerticalDataCache> fontVerticalDataCache;
    306307    return fontVerticalDataCache;
    307308}
     
    341342    static const FontPlatformData& emptyValue()
    342343    {
    343         DEPRECATED_DEFINE_STATIC_LOCAL(FontPlatformData, key, (0.f, false, false));
     344        static NeverDestroyed<FontPlatformData> key(0.f, false, false);
    344345        return key;
    345346    }
  • trunk/Source/WebCore/platform/graphics/FontCache.h

    r163657 r165641  
    105105class FontCache {
    106106    friend class FontCachePurgePreventer;
     107    friend class WTF::NeverDestroyed<FontCache>;
    107108
    108109    WTF_MAKE_NONCOPYABLE(FontCache); WTF_MAKE_FAST_ALLOCATED;
Note: See TracChangeset for help on using the changeset viewer.