summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/spellcheck_host_impl.cc17
1 files changed, 8 insertions, 9 deletions
diff --git a/chrome/browser/spellcheck_host_impl.cc b/chrome/browser/spellcheck_host_impl.cc
index 79a07c1..cdaaf17 100644
--- a/chrome/browser/spellcheck_host_impl.cc
+++ b/chrome/browser/spellcheck_host_impl.cc
@@ -29,14 +29,10 @@
namespace {
FilePath GetFirstChoiceFilePath(const std::string& language) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
+
FilePath dict_dir;
- {
- // This should not do blocking IO from the UI thread!
- // Temporarily allow it for now.
- // http://code.google.com/p/chromium/issues/detail?id=60643
- base::ThreadRestrictions::ScopedAllowIO allow_io;
- PathService::Get(chrome::DIR_APP_DICTIONARIES, &dict_dir);
- }
+ PathService::Get(chrome::DIR_APP_DICTIONARIES, &dict_dir);
return SpellCheckCommon::GetVersionedFileName(language, dict_dir);
}
@@ -94,8 +90,6 @@ SpellCheckHostImpl::SpellCheckHostImpl(
PathService::Get(chrome::DIR_USER_DATA, &personal_file_directory);
custom_dictionary_file_ =
personal_file_directory.Append(chrome::kCustomDictionaryFileName);
-
- bdict_file_path_ = GetFirstChoiceFilePath(language);
}
SpellCheckHostImpl::~SpellCheckHostImpl() {
@@ -149,6 +143,11 @@ void SpellCheckHostImpl::AddWord(const std::string& word) {
void SpellCheckHostImpl::InitializeDictionaryLocation() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
+ // Initialize the BDICT path. This initialization should be in the FILE thread
+ // because it checks if there is a "Dictionaries" directory and create it.
+ if (bdict_file_path_.empty())
+ bdict_file_path_ = GetFirstChoiceFilePath(language_);
+
#if defined(OS_WIN)
// Check if the dictionary exists in the fallback location. If so, use it
// rather than downloading anew.