Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2584)

Unified Diff: chrome/browser/chromeos/base/locale_util.cc

Issue 2699403003: Avoid touching fonts in ResourceBundle while reloading locale (Closed)
Patch Set: +comment. rebase. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/base/locale_util.cc
diff --git a/chrome/browser/chromeos/base/locale_util.cc b/chrome/browser/chromeos/base/locale_util.cc
index 2ee1a76d0498f19d96698f6b006017de4f0bd45b..e0621909392862d611cb29d8b4219c74d604dc5c 100644
--- a/chrome/browser/chromeos/base/locale_util.cc
+++ b/chrome/browser/chromeos/base/locale_util.cc
@@ -51,8 +51,6 @@ void SwitchLanguageDoReloadLocale(SwitchLanguageData* data) {
data->result.requested_locale);
data->result.success = !data->result.loaded_locale.empty();
-
- ResourceBundle::GetSharedInstance().ReloadFonts();
}
// Callback after SwitchLanguageDoReloadLocale() back in UI thread.
@@ -93,6 +91,10 @@ void FinishSwitchLanguage(std::unique_ptr<SwitchLanguageData> data) {
}
}
}
+
+ // The font clean up of ResourceBundle should be done on UI thread, since the
+ // cached fonts are thread unsafe.
+ ResourceBundle::GetSharedInstance().ReloadFonts();
sky 2017/02/21 17:51:06 Could you make ReloadFonts DCHECK it's on the main
gfx::PlatformFontLinux::ReloadDefaultFont();
if (!data->callback.is_null())
data->callback.Run(data->result);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698