Summary: | Move FontCascadeCache onto FontCache | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Chris Lord <clord> | ||||||
Component: | WebCore Misc. | Assignee: | Chris Lord <clord> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | achristensen, darin, ews-watchlist, heycam, mmaxfield, rbuis, sam, simon.fraser, thorton, webkit-bug-importer | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | WebKit Nightly Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Bug Depends on: | |||||||||
Bug Blocks: | 219283, 202793 | ||||||||
Attachments: |
|
Description
Chris Lord
2021-01-22 03:40:41 PST
Created attachment 418136 [details]
Patch
Comment on attachment 418136 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=418136&action=review > Source/WebCore/ChangeLog:9 > + Make FontCascadeCache and associated functions a child of FontCache, > + accessible via FontCache::singleton. Why? (In reply to Myles C. Maxfield from comment #3) > Comment on attachment 418136 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=418136&action=review > > > Source/WebCore/ChangeLog:9 > > + Make FontCascadeCache and associated functions a child of FontCache, > > + accessible via FontCache::singleton. > > Why? In the world of a thread-safe FontCache, having FontCascadeCache live on it makes it much easier to handle locking with a shared lock. I guess it could just as well be its own class if we promoted it to a full singleton class instead of a HashMap typedef. Created attachment 421170 [details]
Patch
Committed r273237: <https://commits.webkit.org/r273237> All reviewed patches have been landed. Closing bug and clearing flags on attachment 421170 [details]. Comment on attachment 421170 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=421170&action=review > Source/WebCore/platform/graphics/FontCache.h:188 > +struct FontCascadeCacheEntry { > + WTF_MAKE_FAST_ALLOCATED; > +public: Just moved code, but: Better style is WTF_MAKE_STRUCT_FAST_ALLOCATED instead. > Source/WebCore/platform/graphics/FontCache.h:192 > + FontCascadeCacheEntry(FontCascadeCacheKey&& key, Ref<FontCascadeFonts>&& fonts) > + : key(WTFMove(key)) > + , fonts(WTFMove(fonts)) > + { } Just moved code, but: We should be able to remove this and make minimal changes to get everything compiling. > Source/WebCore/platform/graphics/FontCache.h:198 > +typedef HashMap<unsigned, std::unique_ptr<FontCascadeCacheEntry>, AlreadyHashed> FontCascadeCache; Just moved code, but: In new code we want "using" here, not "typedef". Comment on attachment 421170 [details]
Patch
(webkit-patch went awry.)
|