diff options
author | nkostylev@chromium.org <nkostylev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-24 14:37:08 +0000 |
---|---|---|
committer | nkostylev@chromium.org <nkostylev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-24 14:37:08 +0000 |
commit | 61f93215693a7f4f416b1aab7cfe3ed530428e55 (patch) | |
tree | a184ea61d349d44be82d0c7a6394ed4c38ce6fb3 | |
parent | ee6ded3a3ee81a38ccd4b1691ff87351a9aaf91e (diff) | |
download | chromium_src-61f93215693a7f4f416b1aab7cfe3ed530428e55.zip chromium_src-61f93215693a7f4f416b1aab7cfe3ed530428e55.tar.gz chromium_src-61f93215693a7f4f416b1aab7cfe3ed530428e55.tar.bz2 |
Temporary whitelist several cases of disk I/O on the UI threads in cros.
BUG=60211, 70097, 70119, 70131, 62626, 61143, chromium-os:11102, chromium-os:11104, chromium-os:11105, chromium-os:11106, chromium-os:11109
TEST=bots
Review URL: http://codereview.chromium.org/6272012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72331 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | base/nss_util.cc | 3 | ||||
-rw-r--r-- | chrome/browser/chromeos/login/apply_services_customization.cc | 1 | ||||
-rw-r--r-- | chrome/browser/chromeos/login/help_app_launcher.cc | 4 | ||||
-rw-r--r-- | chrome/browser/chromeos/login/language_switch_menu.cc | 13 | ||||
-rw-r--r-- | chrome/browser/chromeos/login/login_utils.cc | 13 | ||||
-rw-r--r-- | chrome/browser/chromeos/login/ownership_service.cc | 4 | ||||
-rw-r--r-- | chrome/browser/chromeos/login/update_screen.cc | 4 | ||||
-rw-r--r-- | chrome/browser/chromeos/login/wizard_controller.cc | 14 | ||||
-rw-r--r-- | chrome/browser/chromeos/metrics_cros_settings_provider.cc | 13 | ||||
-rw-r--r-- | chrome/common/logging_chrome.cc | 4 |
10 files changed, 63 insertions, 10 deletions
diff --git a/base/nss_util.cc b/base/nss_util.cc index 8e250c4..fe78fe0 100644 --- a/base/nss_util.cc +++ b/base/nss_util.cc @@ -165,6 +165,9 @@ class NSSInitSingleton { #if defined(OS_CHROMEOS) void OpenPersistentNSSDB() { if (!chromeos_user_logged_in_) { + // GetDefaultConfigDirectory causes us to do blocking IO on UI thread. + // Temporarily allow it until we fix http://crbug.com.70119 + ThreadRestrictions::ScopedAllowIO allow_io; chromeos_user_logged_in_ = true; real_db_slot_ = OpenUserDB(GetDefaultConfigDirectory(), "Real NSS database"); diff --git a/chrome/browser/chromeos/login/apply_services_customization.cc b/chrome/browser/chromeos/login/apply_services_customization.cc index a1de2f4..4e51c34 100644 --- a/chrome/browser/chromeos/login/apply_services_customization.cc +++ b/chrome/browser/chromeos/login/apply_services_customization.cc @@ -21,7 +21,6 @@ namespace { // URL where to fetch OEM services customization manifest from. -// TODO(denisromanov): Change this to real URL when it becomes available. const char kServicesCustomizationManifestUrl[] = "file:///mnt/partner_partition/etc/chromeos/services_manifest.json"; diff --git a/chrome/browser/chromeos/login/help_app_launcher.cc b/chrome/browser/chromeos/login/help_app_launcher.cc index 2db8032..8a5d062 100644 --- a/chrome/browser/chromeos/login/help_app_launcher.cc +++ b/chrome/browser/chromeos/login/help_app_launcher.cc @@ -6,6 +6,7 @@ #include "base/file_util.h" #include "base/logging.h" +#include "base/threading/thread_restrictions.h" #include "base/utf_string_conversions.h" #include "chrome/browser/chromeos/login/help_app_launcher.h" #include "chrome/common/url_constants.h" @@ -39,6 +40,9 @@ HelpAppLauncher::HelpAppLauncher(gfx::NativeWindow parent_window) // returns GURL instance for it. Otherwise returns an empty GURL. static GURL GetLocalFileUrl(const std::string& base_path, const std::string& filename) { + // Checking for help dir existence causes us to do blocking IO on UI thread. + // Temporarily allow it until we fix http://crosbug.com/11105 + base::ThreadRestrictions::ScopedAllowIO allow_io; FilePath file_path(base_path + filename); if (file_util::PathExists(file_path)) { const std::string path_url = std::string(chrome::kFileScheme) + diff --git a/chrome/browser/chromeos/login/language_switch_menu.cc b/chrome/browser/chromeos/login/language_switch_menu.cc index c8bd42f..18df166 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. diff --git a/chrome/browser/chromeos/login/login_utils.cc b/chrome/browser/chromeos/login/login_utils.cc index 65e4214..42a03ed 100644 --- a/chrome/browser/chromeos/login/login_utils.cc +++ b/chrome/browser/chromeos/login/login_utils.cc @@ -15,6 +15,7 @@ #include "base/string_util.h" #include "base/stringprintf.h" #include "base/synchronization/lock.h" +#include "base/threading/thread_restrictions.h" #include "base/time.h" #include "base/utf_string_conversions.h" #include "chrome/browser/browser_process.h" @@ -221,9 +222,15 @@ void LoginUtilsImpl::CompleteLogin( logging::RedirectChromeLogging(*(CommandLine::ForCurrentProcess())); btl->AddLoginTimeMarker("LoggingRedirected", false); - // The default profile will have been changed because the ProfileManager - // will process the notification that the UserManager sends out. - Profile* profile = profile_manager->GetDefaultProfile(user_data_dir); + Profile* profile = NULL; + { + // Loading user profile causes us to do blocking IO on UI thread. + // Temporarily allow it until we fix http://crosbug.com/11104 + base::ThreadRestrictions::ScopedAllowIO allow_io; + // The default profile will have been changed because the ProfileManager + // will process the notification that the UserManager sends out. + profile = profile_manager->GetDefaultProfile(user_data_dir); + } btl->AddLoginTimeMarker("UserProfileGotten", false); // Change the proxy configuration service of the default request context to diff --git a/chrome/browser/chromeos/login/ownership_service.cc b/chrome/browser/chromeos/login/ownership_service.cc index c256e96..56288a2 100644 --- a/chrome/browser/chromeos/login/ownership_service.cc +++ b/chrome/browser/chromeos/login/ownership_service.cc @@ -7,6 +7,7 @@ #include "base/file_path.h" #include "base/file_util.h" #include "base/lazy_instance.h" +#include "base/threading/thread_restrictions.h" #include "chrome/browser/browser_thread.h" namespace chromeos { @@ -28,6 +29,9 @@ OwnershipService::~OwnershipService() {} bool OwnershipService::IsAlreadyOwned() { + // This should not do blocking IO from the UI thread. + // Temporarily allow it for now. http://crbug.com/70097 + base::ThreadRestrictions::ScopedAllowIO allow_io; return file_util::PathExists(utils_->GetOwnerKeyFilePath()); } diff --git a/chrome/browser/chromeos/login/update_screen.cc b/chrome/browser/chromeos/login/update_screen.cc index 2eb9b14..60884f4 100644 --- a/chrome/browser/chromeos/login/update_screen.cc +++ b/chrome/browser/chromeos/login/update_screen.cc @@ -6,6 +6,7 @@ #include "base/file_util.h" #include "base/logging.h" +#include "base/threading/thread_restrictions.h" #include "chrome/browser/chromeos/cros/cros_library.h" #include "chrome/browser/chromeos/login/screen_observer.h" #include "chrome/browser/chromeos/login/update_view.h" @@ -208,6 +209,9 @@ bool UpdateScreen::HasCriticalUpdate() { return true; std::string deadline; + // Checking for update flag file causes us to do blocking IO on UI thread. + // Temporarily allow it until we fix http://crosbug.com/11106 + base::ThreadRestrictions::ScopedAllowIO allow_io; FilePath update_deadline_file_path(kUpdateDeadlineFile); if (!file_util::ReadFileToString(update_deadline_file_path, &deadline) || deadline.empty()) { diff --git a/chrome/browser/chromeos/login/wizard_controller.cc b/chrome/browser/chromeos/login/wizard_controller.cc index 8362593..a865488 100644 --- a/chrome/browser/chromeos/login/wizard_controller.cc +++ b/chrome/browser/chromeos/login/wizard_controller.cc @@ -14,6 +14,7 @@ #include "base/command_line.h" #include "base/file_util.h" #include "base/logging.h" +#include "base/threading/thread_restrictions.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/chromeos/cros/cros_library.h" #include "chrome/browser/chromeos/cros/cryptohome_library.h" @@ -192,7 +193,9 @@ void DeleteWizardControllerAndLaunchBrowser(WizardController* controller) { } const chromeos::StartupCustomizationDocument* LoadStartupManifest() { - // Load partner customization startup manifest if it is available. + // Loading manifest causes us to do blocking IO on UI thread. + // Temporarily allow it until we fix http://crosbug.com/11103 + base::ThreadRestrictions::ScopedAllowIO allow_io; FilePath startup_manifest_path(kStartupCustomizationManifestPath); if (file_util::PathExists(startup_manifest_path)) { scoped_ptr<chromeos::StartupCustomizationDocument> customization( @@ -828,6 +831,9 @@ void WizardController::MarkOobeCompleted() { // static bool WizardController::IsDeviceRegistered() { + // Checking for flag file causes us to do blocking IO on UI thread. + // Temporarily allow it until we fix http://crbug.com/70131 + base::ThreadRestrictions::ScopedAllowIO allow_io; FilePath oobe_complete_flag_file_path(kOobeCompleteFlagFilePath); return file_util::PathExists(oobe_complete_flag_file_path); } @@ -846,6 +852,9 @@ bool WizardController::IsRegisterScreenDefined() { // static void WizardController::MarkDeviceRegistered() { + // Creating flag file causes us to do blocking IO on UI thread. + // Temporarily allow it until we fix http://crbug.com/70131 + base::ThreadRestrictions::ScopedAllowIO allow_io; // Create flag file for boot-time init scripts. FilePath oobe_complete_path(kOobeCompleteFlagFilePath); FILE* oobe_flag_file = file_util::OpenFile(oobe_complete_path, "w+b"); @@ -1009,6 +1018,9 @@ void ShowLoginWizard(const std::string& first_screen_name, locale = controller->GetCustomization()->initial_locale(); VLOG(1) << "Initial locale: " << locale; if (!locale.empty()) { + // 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; const std::string loaded_locale = ResourceBundle::ReloadSharedInstance(locale); CHECK(!loaded_locale.empty()) << "Locale could not be found for " diff --git a/chrome/browser/chromeos/metrics_cros_settings_provider.cc b/chrome/browser/chromeos/metrics_cros_settings_provider.cc index 47759bc..f9edb24 100644 --- a/chrome/browser/chromeos/metrics_cros_settings_provider.cc +++ b/chrome/browser/chromeos/metrics_cros_settings_provider.cc @@ -5,6 +5,7 @@ #include "chrome/browser/chromeos/metrics_cros_settings_provider.h" #include "base/string_util.h" +#include "base/threading/thread_restrictions.h" #include "base/values.h" #include "chrome/browser/chromeos/cros_settings.h" #include "chrome/browser/chromeos/cros_settings_names.h" @@ -43,7 +44,14 @@ bool MetricsCrosSettingsProvider::SetMetricsStatus(bool enabled) { if (user->user_is_logged_in() && !user->current_user_is_owner()) return false; VLOG(1) << "Setting cros stats/crash metric reporting to " << enabled; - if (enabled != GoogleUpdateSettings::GetCollectStatsConsent()) { + bool collect_stats_consent = false; + { + // Loading consent file state causes us to do blocking IO on UI thread. + // Temporarily allow it until we fix http://crbug.com/62626 + base::ThreadRestrictions::ScopedAllowIO allow_io; + collect_stats_consent = GoogleUpdateSettings::GetCollectStatsConsent(); + } + if (enabled != collect_stats_consent) { bool new_enabled = OptionsUtil::ResolveMetricsReportingEnabled(enabled); #if defined(USE_LINUX_BREAKPAD) if (new_enabled) @@ -62,6 +70,9 @@ bool MetricsCrosSettingsProvider::SetMetricsStatus(bool enabled) { // static bool MetricsCrosSettingsProvider::GetMetricsStatus() { + // Loading consent file state causes us to do blocking IO on UI thread. + // Temporarily allow it until we fix http://crbug.com/62626 + base::ThreadRestrictions::ScopedAllowIO allow_io; return GoogleUpdateSettings::GetCollectStatsConsent(); } diff --git a/chrome/common/logging_chrome.cc b/chrome/common/logging_chrome.cc index 9653c40..5ea8012 100644 --- a/chrome/common/logging_chrome.cc +++ b/chrome/common/logging_chrome.cc @@ -40,6 +40,7 @@ #include "base/path_service.h" #include "base/string_number_conversions.h" #include "base/string_util.h" +#include "base/threading/thread_restrictions.h" #include "base/time.h" #include "base/utf_string_conversions.h" #include "chrome/common/chrome_paths.h" @@ -213,6 +214,9 @@ void RedirectChromeLogging(const CommandLine& command_line) { // defaults to the profile dir. FilePath log_path = GetSessionLogFile(command_line); + // Creating symlink causes us to do blocking IO on UI thread. + // Temporarily allow it until we fix http://crbug.com/61143 + base::ThreadRestrictions::ScopedAllowIO allow_io; // Always force a new symlink when redirecting. FilePath target_path = SetUpSymlinkIfNeeded(log_path, true); |