Changeset 267009 in webkit


Ignore:
Timestamp:
Sep 14, 2020 1:38:53 AM (4 years ago)
Author:
Chris Lord
Message:

CSS parsing-related singletons should only be used on the main thread
https://bugs.webkit.org/show_bug.cgi?id=216370

Reviewed by Darin Adler.

Mark some singletons that aren't safe to use off the main thread as
MainThreadNeverDestroyed instead of just NeverDestroyed.

No new tests because there is no behavior change.

  • css/CSSValuePool.cpp:

(WebCore::CSSValuePool::singleton):

  • css/parser/CSSParserContext.cpp:

(WebCore::strictCSSParserContext):

  • rendering/RenderThemeAdwaita.cpp:

(WebCore::RenderTheme::singleton):

  • rendering/RenderThemeGtk.cpp:

(WebCore::RenderTheme::singleton):

Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r267008 r267009  
     12020-09-14  Chris Lord  <clord@igalia.com>
     2
     3        CSS parsing-related singletons should only be used on the main thread
     4        https://bugs.webkit.org/show_bug.cgi?id=216370
     5
     6        Reviewed by Darin Adler.
     7
     8        Mark some singletons that aren't safe to use off the main thread as
     9        MainThreadNeverDestroyed instead of just NeverDestroyed.
     10
     11        No new tests because there is no behavior change.
     12
     13        * css/CSSValuePool.cpp:
     14        (WebCore::CSSValuePool::singleton):
     15        * css/parser/CSSParserContext.cpp:
     16        (WebCore::strictCSSParserContext):
     17        * rendering/RenderThemeAdwaita.cpp:
     18        (WebCore::RenderTheme::singleton):
     19        * rendering/RenderThemeGtk.cpp:
     20        (WebCore::RenderTheme::singleton):
     21
    1222020-09-14  Myles C. Maxfield  <mmaxfield@apple.com>
    223
  • trunk/Source/WebCore/css/CSSValuePool.cpp

    r264585 r267009  
    7474CSSValuePool& CSSValuePool::singleton()
    7575{
    76     ASSERT(isMainThread());
    77     static NeverDestroyed<CSSValuePool> pool;
     76    static MainThreadNeverDestroyed<CSSValuePool> pool;
    7877    return pool;
    7978}
  • trunk/Source/WebCore/css/parser/CSSParserContext.cpp

    r255151 r267009  
    3838const CSSParserContext& strictCSSParserContext()
    3939{
    40     static NeverDestroyed<CSSParserContext> strictContext(HTMLStandardMode);
     40    static MainThreadNeverDestroyed<CSSParserContext> strictContext(HTMLStandardMode);
    4141    return strictContext;
    4242}
  • trunk/Source/WebCore/rendering/RenderThemeAdwaita.cpp

    r264565 r267009  
    8080RenderTheme& RenderTheme::singleton()
    8181{
    82     static NeverDestroyed<RenderThemeAdwaita> theme;
     82    static MainThreadNeverDestroyed<RenderThemeAdwaita> theme;
    8383    return theme;
    8484}
  • trunk/Source/WebCore/rendering/RenderThemeGtk.cpp

    r257299 r267009  
    3333RenderTheme& RenderTheme::singleton()
    3434{
    35     static NeverDestroyed<RenderThemeGtk> theme;
     35    static MainThreadNeverDestroyed<RenderThemeGtk> theme;
    3636    return theme;
    3737}
Note: See TracChangeset for help on using the changeset viewer.