Bug 234060 - Make FontCache::invalidateAllFontCaches call invalidate on all worker FontCaches
Summary: Make FontCache::invalidateAllFontCaches call invalidate on all worker FontCaches
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Cameron McCormack (:heycam)
URL:
Keywords: InRadar
Depends on:
Blocks: 233488
  Show dependency treegraph
 
Reported: 2021-12-08 18:47 PST by Cameron McCormack (:heycam)
Modified: 2022-07-24 20:58 PDT (History)
7 users (show)

See Also:


Attachments
Patch (3.76 KB, patch)
2021-12-08 18:49 PST, Cameron McCormack (:heycam)
darin: review+
Details | Formatted Diff | Diff
Patch (3.99 KB, patch)
2022-07-24 19:50 PDT, Matt Woodrow
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Cameron McCormack (:heycam) 2021-12-08 18:47:48 PST
Make FontCache::invalidateAllFontCaches call invalidate on all worker FontCaches
Comment 1 Cameron McCormack (:heycam) 2021-12-08 18:49:38 PST
Created attachment 446481 [details]
Patch
Comment 2 Darin Adler 2021-12-08 19:00:05 PST
Comment on attachment 446481 [details]
Patch

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

> Source/WebCore/platform/graphics/FontCache.cpp:397
> +static void callOnAllFontCaches(F function)

Can we use WTF::function instead of making this entire thing a template?

Is "call" really the right way to describe something that posts tasks on the run loop?

> Source/WebCore/platform/graphics/FontCache.cpp:417
> +void FontCache::invalidateAllFontCaches()
> +{
> +    callOnAllFontCaches([](FontCache& fontCache) {
> +        fontCache.invalidate();
> +    });
>  }

For the purposes that callers intend, is it OK that this posts tasks that invalidate the font caches in the future, and doesn’t finish invalidating them before returning? Should we change the name to make that clearer?
Comment 3 Radar WebKit Bug Importer 2021-12-15 18:48:16 PST
<rdar://problem/86553783>
Comment 4 Matt Woodrow 2022-07-24 19:50:08 PDT
(In reply to Darin Adler from comment #2)
> Comment on attachment 446481 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=446481&action=review
> 
> > Source/WebCore/platform/graphics/FontCache.cpp:397
> > +static void callOnAllFontCaches(F function)
> 
> Can we use WTF::function instead of making this entire thing a template?

WTF::function isn't copyable, so we can't pass it to all of the worker threads. Adding something like a thread safe refcounted wrapper doesn't seem worth it to me.
Comment 5 Matt Woodrow 2022-07-24 19:50:24 PDT
Created attachment 461188 [details]
Patch
Comment 6 EWS 2022-07-24 20:58:19 PDT
Committed 252778@main (073740c9d994): <https://commits.webkit.org/252778@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 461188 [details].