diff options
author | nkostylev@chromium.org <nkostylev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-03 16:50:36 +0000 |
---|---|---|
committer | nkostylev@chromium.org <nkostylev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-03 16:50:36 +0000 |
commit | 1182a58fe27eded9877b88063de5e4abe02926e4 (patch) | |
tree | 0bb7a67e40cab37ee98c860840b933d33a81cdf3 | |
parent | 62f95efe880a7e23e0d78fb42ed816637d840bbb (diff) | |
download | chromium_src-1182a58fe27eded9877b88063de5e4abe02926e4.zip chromium_src-1182a58fe27eded9877b88063de5e4abe02926e4.tar.gz chromium_src-1182a58fe27eded9877b88063de5e4abe02926e4.tar.bz2 |
[cros] Mobile activation - temporary whitelist disk I/O on UI thread.
BUG=chromium-os:11535
TEST=No DCHECKs during activation.
Review URL: http://codereview.chromium.org/6368078
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@73629 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/chromeos/dom_ui/mobile_setup_ui.cc | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/chrome/browser/chromeos/dom_ui/mobile_setup_ui.cc b/chrome/browser/chromeos/dom_ui/mobile_setup_ui.cc index bb03092..cc352e1 100644 --- a/chrome/browser/chromeos/dom_ui/mobile_setup_ui.cc +++ b/chrome/browser/chromeos/dom_ui/mobile_setup_ui.cc @@ -17,6 +17,7 @@ #include "base/string_piece.h" #include "base/string_util.h" #include "base/utf_string_conversions.h" +#include "base/threading/thread_restrictions.h" #include "base/timer.h" #include "base/values.h" #include "base/weak_ptr.h" @@ -345,8 +346,13 @@ bool CellularConfigDocument::LoadFromFile(const FilePath& config_path) { error_map_.clear(); std::string config; - if (!file_util::ReadFileToString(config_path, &config)) - return false; + { + // Reading config file causes us to do blocking IO on UI thread. + // Temporarily allow it until we fix http://crosbug.com/11535 + base::ThreadRestrictions::ScopedAllowIO allow_io; + if (!file_util::ReadFileToString(config_path, &config)) + return false; + } scoped_ptr<Value> root(base::JSONReader::Read(config, true)); DCHECK(root.get() != NULL); @@ -1262,7 +1268,14 @@ void MobileSetupHandler::LoadCellularConfig() { config_loaded = true; // Load partner customization startup manifest if it is available. FilePath config_path(kCellularConfigPath); - if (file_util::PathExists(config_path)) { + bool config_exists = false; + { + // Reading config file causes us to do blocking IO on UI thread. + // Temporarily allow it until we fix http://crosbug.com/11535 + base::ThreadRestrictions::ScopedAllowIO allow_io; + config_exists = file_util::PathExists(config_path); + } + if (config_exists) { scoped_ptr<CellularConfigDocument> config(new CellularConfigDocument()); bool config_loaded = config->LoadFromFile(config_path); if (config_loaded) { |