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
parent ee6ded3a
......@@ -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");
......
......@@ -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";
......
......@@ -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) +
......
......@@ -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.
......
......@@ -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
......
......@@ -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());
}
......
......@@ -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()) {
......
......@@ -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 "
......
......@@ -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();
}
......
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment