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

Unified Diff: chrome/browser/chromeos/metrics_cros_settings_provider.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: cleanup WizardInProcessBrowserTest 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
Index: chrome/browser/chromeos/metrics_cros_settings_provider.cc
diff --git a/chrome/browser/chromeos/metrics_cros_settings_provider.cc b/chrome/browser/chromeos/metrics_cros_settings_provider.cc
index 47759bc603a1326825183e9cdc03900b38b3f25d..f9edb24e5ef05b6430f9a4a3156752ab559650a2 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();
}

Powered by Google App Engine
This is Rietveld 408576698