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

Unified Diff: chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc

Issue 1106593002: [chrome/browser/se*-ss*] favor DCHECK_CURRENTLY_ON for better logs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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/spellchecker/spellcheck_hunspell_dictionary.cc
diff --git a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc
index 479a8f0d117dbd453e61e1d53c30c9f0457efb53..7881ba824621508560740e2a4765c657658f712c 100644
--- a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc
+++ b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc
@@ -28,7 +28,7 @@ namespace {
// Close the file.
void CloseDictionary(base::File file) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
+ DCHECK_CURRENTLY_ON(BrowserThread::FILE);
file.Close();
}
@@ -36,7 +36,7 @@ void CloseDictionary(base::File file) {
// returns false.
bool SaveDictionaryData(scoped_ptr<std::string> data,
const base::FilePath& path) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
+ DCHECK_CURRENTLY_ON(BrowserThread::FILE);
size_t bytes_written =
base::WriteFile(path, data->data(), data->length());
@@ -106,7 +106,7 @@ SpellcheckHunspellDictionary::~SpellcheckHunspellDictionary() {
}
void SpellcheckHunspellDictionary::Load() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
#if defined(OS_MACOSX)
if (spellcheck_mac::SpellCheckerAvailable() &&
@@ -132,7 +132,7 @@ void SpellcheckHunspellDictionary::Load() {
void SpellcheckHunspellDictionary::RetryDownloadDictionary(
net::URLRequestContextGetter* request_context_getter) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
request_context_getter_ = request_context_getter;
DownloadDictionary(GetDictionaryURL());
}
@@ -154,12 +154,12 @@ bool SpellcheckHunspellDictionary::IsUsingPlatformChecker() const {
}
void SpellcheckHunspellDictionary::AddObserver(Observer* observer) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
observers_.AddObserver(observer);
}
void SpellcheckHunspellDictionary::RemoveObserver(Observer* observer) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
observers_.RemoveObserver(observer);
}
@@ -174,7 +174,7 @@ bool SpellcheckHunspellDictionary::IsDownloadFailure() {
void SpellcheckHunspellDictionary::OnURLFetchComplete(
const net::URLFetcher* source) {
DCHECK(source);
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
scoped_ptr<net::URLFetcher> fetcher_destructor(fetcher_.release());
if ((source->GetResponseCode() / 100) != 2) {
@@ -224,7 +224,7 @@ GURL SpellcheckHunspellDictionary::GetDictionaryURL() {
}
void SpellcheckHunspellDictionary::DownloadDictionary(GURL url) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(request_context_getter_);
download_status_ = DOWNLOAD_IN_PROGRESS;
@@ -248,7 +248,7 @@ void SpellcheckHunspellDictionary::DownloadDictionary(GURL url) {
// download is chrome::DIR_USER_DATA.
SpellcheckHunspellDictionary::DictionaryFile
SpellcheckHunspellDictionary::OpenDictionaryFile(const base::FilePath& path) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
+ DCHECK_CURRENTLY_ON(BrowserThread::FILE);
DictionaryFile dictionary;
#if defined(OS_WIN)
@@ -291,7 +291,7 @@ SpellcheckHunspellDictionary::OpenDictionaryFile(const base::FilePath& path) {
SpellcheckHunspellDictionary::DictionaryFile
SpellcheckHunspellDictionary::InitializeDictionaryLocation(
const std::string& language) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
+ DCHECK_CURRENTLY_ON(BrowserThread::FILE);
// Initialize the BDICT path. Initialization should be in the FILE thread
// because it checks if there is a "Dictionaries" directory and create it.
@@ -305,7 +305,7 @@ SpellcheckHunspellDictionary::InitializeDictionaryLocation(
void SpellcheckHunspellDictionary::InitializeDictionaryLocationComplete(
DictionaryFile file) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
dictionary_file_ = file.Pass();
if (!dictionary_file_.file.IsValid()) {
@@ -331,7 +331,7 @@ void SpellcheckHunspellDictionary::InitializeDictionaryLocationComplete(
void SpellcheckHunspellDictionary::SaveDictionaryDataComplete(
bool dictionary_saved) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (dictionary_saved) {
download_status_ = DOWNLOAD_NONE;
« no previous file with comments | « chrome/browser/spellchecker/spellcheck_custom_dictionary.cc ('k') | chrome/browser/spellchecker/spellcheck_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698