Use finer grained locking in FontDatabase
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Oct 2018 18:39:05 +0000 (18:39 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Oct 2018 18:39:05 +0000 (18:39 +0000)
commita8148e1b60fa3ebf94d1f79a2f02313337686a35
treee53ef51f6feb95feed9344d7df9eb813b8db03aa
parentcaecb3503e652102ee34c77c744ae26f537b7a69
Use finer grained locking in FontDatabase
https://bugs.webkit.org/show_bug.cgi?id=190467

Reviewed by Alex Christensen.

* platform/graphics/FontCache.h:

Also use ListHashSet for prewarming info so we can prewarm in the same order the fonts were
seen last time.

* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::FontDatabase::collectionForFamily):

Only hold the lock when accessing the hashmap. There is no need to hold it during font construction
which can take a long time.

(WebCore::FontDatabase::fontForPostScriptName):

This is currently not prewarmed from a thread so no need for locking.

(WebCore::FontDatabase::clear):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237040 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/FontCache.h
Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp