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); |