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

Unified Diff: chrome/browser/chromeos/login/language_switch_menu.cc

Issue 6272012: Temporary whitelist several cases of disk I/O on the UI threads in cros. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/browser/chromeos
Patch Set: remove UI thread restriction, nits Created 9 years, 11 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 | « chrome/browser/chromeos/login/help_app_launcher.cc ('k') | chrome/browser/chromeos/login/login_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/language_switch_menu.cc
diff --git a/chrome/browser/chromeos/login/language_switch_menu.cc b/chrome/browser/chromeos/login/language_switch_menu.cc
index c8bd42faa57b1812a021bb775400258ded8a90a2..18df1667944c91e4129c561a0d152353c0173b1b 100644
--- a/chrome/browser/chromeos/login/language_switch_menu.cc
+++ b/chrome/browser/chromeos/login/language_switch_menu.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/chromeos/login/language_switch_menu.h"
#include "base/i18n/rtl.h"
+#include "base/threading/thread_restrictions.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chromeos/cros/cros_library.h"
@@ -91,10 +92,14 @@ void LanguageSwitchMenu::SwitchLanguage(const std::string& locale) {
if (!prefs->IsManagedPreference(prefs::kApplicationLocale)) {
prefs->SetString(prefs::kApplicationLocale, locale);
prefs->SavePersistentPrefs();
-
- // Switch the locale.
- const std::string loaded_locale =
- ResourceBundle::ReloadSharedInstance(locale);
+ std::string loaded_locale;
+ {
+ // Reloading resource bundle causes us to do blocking IO on UI thread.
+ // Temporarily allow it until we fix http://crosbug.com/11102
+ base::ThreadRestrictions::ScopedAllowIO allow_io;
+ // Switch the locale.
+ loaded_locale = ResourceBundle::ReloadSharedInstance(locale);
+ }
CHECK(!loaded_locale.empty()) << "Locale could not be found for " << locale;
// Enable the keyboard layouts that are necessary for the new locale.
« no previous file with comments | « chrome/browser/chromeos/login/help_app_launcher.cc ('k') | chrome/browser/chromeos/login/login_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698