Bug 208389 - Clear FontDatabase when low-memory-warning happens
Summary: Clear FontDatabase when low-memory-warning happens
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Yusuke Suzuki
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-02-28 13:16 PST by Yusuke Suzuki
Modified: 2020-02-28 13:40 PST (History)
4 users (show)

See Also:


Attachments
Patch (1.57 KB, patch)
2020-02-28 13:16 PST, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (1.61 KB, patch)
2020-02-28 13:17 PST, Yusuke Suzuki
cdumez: review+
cdumez: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yusuke Suzuki 2020-02-28 13:16:06 PST
Clear FontDatabase when low-memory-warning happens
Comment 1 Yusuke Suzuki 2020-02-28 13:16:55 PST
Created attachment 392011 [details]
Patch
Comment 2 Yusuke Suzuki 2020-02-28 13:17:40 PST
Created attachment 392012 [details]
Patch
Comment 3 Chris Dumez 2020-02-28 13:34:22 PST
Comment on attachment 392012 [details]
Patch

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

r=me with change.

> Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp:1385
> +#if HAVE(DISALLOWABLE_USER_INSTALLED_FONTS)

You can replace all this with simply:
    FontDatabase::singletonAllowingUserInstalledFonts().clear();
    FontDatabase::singletonDisallowingUserInstalledFonts().clear();

without ifdefs. FontDatabase::singletonAllowingUserInstalledFonts() & FontDatabase::singletonDisallowingUserInstalledFonts() resolve to FontDatabase::singleton() when !HAVE(DISALLOWABLE_USER_INSTALLED_FONTS)
Comment 4 Yusuke Suzuki 2020-02-28 13:36:51 PST
Comment on attachment 392012 [details]
Patch

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

>> Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp:1385
>> +#if HAVE(DISALLOWABLE_USER_INSTALLED_FONTS)
> 
> You can replace all this with simply:
>     FontDatabase::singletonAllowingUserInstalledFonts().clear();
>     FontDatabase::singletonDisallowingUserInstalledFonts().clear();
> 
> without ifdefs. FontDatabase::singletonAllowingUserInstalledFonts() & FontDatabase::singletonDisallowingUserInstalledFonts() resolve to FontDatabase::singleton() when !HAVE(DISALLOWABLE_USER_INSTALLED_FONTS)

Changed.
Comment 5 Yusuke Suzuki 2020-02-28 13:39:11 PST
Committed r257657: <https://trac.webkit.org/changeset/257657>
Comment 6 Radar WebKit Bug Importer 2020-02-28 13:40:15 PST
<rdar://problem/59900871>