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

Unified Diff: chrome/browser/dom_ui/options/import_data_handler.cc

Issue 4146004: ThreadRestrictions: disallow blocking IO on the UI thread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more Created 10 years, 2 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/dom_ui/options/import_data_handler.cc
diff --git a/chrome/browser/dom_ui/options/import_data_handler.cc b/chrome/browser/dom_ui/options/import_data_handler.cc
index d57e6168a3da626f46cb94192fec676ef3001b22..e4037e35401f4cdb49f0aa4b2784b2132889b03f 100644
--- a/chrome/browser/dom_ui/options/import_data_handler.cc
+++ b/chrome/browser/dom_ui/options/import_data_handler.cc
@@ -6,13 +6,14 @@
#include "app/l10n_util.h"
#include "base/basictypes.h"
+#include "base/callback.h"
#include "base/scoped_ptr.h"
#include "base/string16.h"
#include "base/string_number_conversions.h"
#include "base/string_util.h"
+#include "base/thread_restrictions.h"
#include "base/utf_string_conversions.h"
#include "base/values.h"
-#include "base/callback.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profile.h"
#include "grit/chromium_strings.h"
@@ -52,6 +53,11 @@ void ImportDataHandler::GetLocalizedValues(
void ImportDataHandler::Initialize() {
importer_list_.reset(new ImporterList);
+
+ // We should not be loading profiles from the UI thread!
+ // Temporarily allow this until we fix
+ // http://code.google.com/p/chromium/issues/detail?id=60825
+ base::ThreadRestrictions::ScopedAllowIO allow_io;
importer_list_->DetectSourceProfiles();
int profiles_count = importer_list_->GetAvailableProfileCount();

Powered by Google App Engine
This is Rietveld 408576698