fix: resolve font list in default prefernce values (#45905)

* fix: resolve font list in default prefernce values

* chore: fix unsafe buffer usage

* docs: add code comment
This commit is contained in:
Robo 2025-03-07 18:22:03 +09:00 committed by GitHub
parent 041ada1586
commit 530ccfe350
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 168 additions and 12 deletions

View file

@ -13,6 +13,12 @@ struct WebPreferences;
namespace electron {
// Set the default font preferences. The functionality is copied from
// chrome/browser/prefs_tab_helper.cc with modifications to work
// without a preference service and cache chrome/browser/font_family_cache.cc
// that persists across app sessions.
// Keep the core logic in sync to avoid performance regressions
// Refs https://issues.chromium.org/issues/400473071
void SetFontDefaults(blink::web_pref::WebPreferences* prefs);
} // namespace electron