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

Unified Diff: chrome/browser/spellchecker.cc

Issue 342090: Use ChromeThread::DeleteOnIOThread in a few places where an object must be de... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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
« no previous file with comments | « chrome/browser/spellchecker.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/spellchecker.cc
===================================================================
--- chrome/browser/spellchecker.cc (revision 30863)
+++ chrome/browser/spellchecker.cc (working copy)
@@ -13,7 +13,6 @@
#include "base/path_service.h"
#include "base/stats_counters.h"
#include "base/string_util.h"
-#include "chrome/browser/chrome_thread.h"
#include "chrome/browser/net/url_fetcher.h"
#include "chrome/browser/profile.h"
#include "chrome/browser/spellchecker_common.h"
@@ -221,15 +220,12 @@
ChromeThread::PostTask(
ChromeThread::IO, FROM_HERE,
NewRunnableMethod(
- spellchecker_, &SpellChecker::HunspellInited, hunspell_,
+ spellchecker_.get(), &SpellChecker::HunspellInited, hunspell_,
bdict_file_, file_existed));
}
- // The SpellChecker we are working for. We are guaranteed to be outlived
- // by this object because it AddRefs() itself before calling us.
- // Accessing it is not necessarily thread safe, but are careful to only access
- // it in ways that are.
- SpellChecker* spellchecker_;
+ // The SpellChecker we are working for.
+ scoped_refptr<SpellChecker> spellchecker_;
Hunspell* hunspell_;
file_util::MemoryMappedFile* bdict_file_;
@@ -537,8 +533,6 @@
FilePath dictionary_file_name_usr = GetVersionedFileName(language_,
dict_dir_userdata);
- // Balances Release() in HunspellInited().
- AddRef();
ChromeThread::PostTask(
ChromeThread::FILE, FROM_HERE,
new ReadDictionaryTask(
@@ -560,9 +554,6 @@
// File didn't exist. We need to download a dictionary.
DoDictionaryDownload();
}
-
- // Balances AddRef() in Initialize().
- Release();
return;
}
@@ -574,9 +565,6 @@
hunspell_->add(custom_words_.front().c_str());
custom_words_.pop();
}
-
- // Balances AddRef() in Initialize().
- Release();
}
void SpellChecker::DoDictionaryDownload() {
« no previous file with comments | « chrome/browser/spellchecker.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698