Changeset 223600 in webkit


Ignore:
Timestamp:
Oct 18, 2017 4:05:40 AM (6 years ago)
Author:
commit-queue@webkit.org
Message:

Use LazyNeverDestroyed instead of DEFINE_GLOBAL for WebKitFontFamilyNames
https://bugs.webkit.org/show_bug.cgi?id=175106

Patch by Fujii Hironori <Fujii Hironori> on 2017-10-18
Reviewed by Yusuke Suzuki.

No new tests because there is no behavior change.

  • css/CSSFontFaceSet.cpp:

(WebCore::CSSFontFaceSet::familyNameFromPrimitive): Call get() method of LazyNeverDestroyed.

  • dom/make_names.pl: Use LazyNeverDestroyed for font names.
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r223596 r223600  
     12017-10-18  Fujii Hironori  <Hironori.Fujii@sony.com>
     2
     3        Use LazyNeverDestroyed instead of DEFINE_GLOBAL for WebKitFontFamilyNames
     4        https://bugs.webkit.org/show_bug.cgi?id=175106
     5
     6        Reviewed by Yusuke Suzuki.
     7
     8        No new tests because there is no behavior change.
     9
     10        * css/CSSFontFaceSet.cpp:
     11        (WebCore::CSSFontFaceSet::familyNameFromPrimitive): Call get() method of LazyNeverDestroyed.
     12        * dom/make_names.pl: Use LazyNeverDestroyed for font names.
     13
    1142017-10-18  Zan Dobersek  <zdobersek@igalia.com>
    215
  • trunk/Source/WebCore/css/CSSFontFaceSet.cpp

    r222926 r223600  
    132132    switch (value.valueID()) {
    133133    case CSSValueSerif:
    134         return serifFamily;
     134        return serifFamily.get();
    135135    case CSSValueSansSerif:
    136         return sansSerifFamily;
     136        return sansSerifFamily.get();
    137137    case CSSValueCursive:
    138         return cursiveFamily;
     138        return cursiveFamily.get();
    139139    case CSSValueFantasy:
    140         return fantasyFamily;
     140        return fantasyFamily.get();
    141141    case CSSValueMonospace:
    142         return monospaceFamily;
     142        return monospaceFamily.get();
    143143    case CSSValueWebkitPictograph:
    144         return pictographFamily;
     144        return pictographFamily.get();
    145145    case CSSValueSystemUi:
    146         return systemUiFamily;
     146        return systemUiFamily.get();
    147147    default:
    148148        return { };
  • trunk/Source/WebCore/dom/make_names.pl

    r223314 r223600  
    110110
    111111    printLicenseHeader($F);
    112     printHeaderHead($F, "CSS", $familyNamesFileBase, "#include <wtf/text/AtomicString.h>", "");
    113 
    114     printMacros($F, "extern const WTF::AtomicString", "", \%parameters);
     112    printHeaderHead($F, "CSS", $familyNamesFileBase, <<END, "");
     113#include <wtf/NeverDestroyed.h>
     114#include <wtf/text/AtomicString.h>
     115END
     116
     117    printMacros($F, "extern LazyNeverDestroyed<const WTF::AtomicString>", "", \%parameters);
    115118    print F "#endif\n\n";
    116119
     
    126129    print F StaticString::GenerateStrings(\%parameters);
    127130
    128     for my $name (sort keys %parameters) {
    129         print F "DEFINE_GLOBAL(AtomicString, $name)\n";
    130     }
     131    printMacros($F, "LazyNeverDestroyed<const WTF::AtomicString>", "", \%parameters);
    131132
    132133    printInit($F, 0);
     
    139140        # depending on whether SKIP_STATIC_CONSTRUCTORS_ON_GCC is used, so stick with a
    140141        # C-style cast for now.
    141         print F "    new (NotNull, (void*)&$name) AtomicString(&${name}Data);\n";
     142        print F "    ${name}.construct(&${name}Data);\n";
    142143    }
    143144
Note: See TracChangeset for help on using the changeset viewer.