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

Unified Diff: chrome/browser/download/download_history.cc

Issue 1090323003: [chrome/browser/download] 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
« no previous file with comments | « chrome/browser/download/download_crx_util.cc ('k') | chrome/browser/download/download_history_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_history.cc
diff --git a/chrome/browser/download/download_history.cc b/chrome/browser/download/download_history.cc
index 05c5a5d7df9c47a5d04d8446a88f558c0192f79c..becc0e55a9b176f50e096857a088c1eac42359dc 100644
--- a/chrome/browser/download/download_history.cc
+++ b/chrome/browser/download/download_history.cc
@@ -212,7 +212,7 @@ DownloadHistory::DownloadHistory(content::DownloadManager* manager,
loading_id_(content::DownloadItem::kInvalidId),
history_size_(0),
weak_ptr_factory_(this) {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
content::DownloadManager::DownloadVector items;
notifier_.GetManager()->GetAllDownloads(&items);
for (content::DownloadManager::DownloadVector::const_iterator
@@ -224,24 +224,24 @@ DownloadHistory::DownloadHistory(content::DownloadManager* manager,
}
DownloadHistory::~DownloadHistory() {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
FOR_EACH_OBSERVER(Observer, observers_, OnDownloadHistoryDestroyed());
observers_.Clear();
}
void DownloadHistory::AddObserver(DownloadHistory::Observer* observer) {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
observers_.AddObserver(observer);
}
void DownloadHistory::RemoveObserver(DownloadHistory::Observer* observer) {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
observers_.RemoveObserver(observer);
}
bool DownloadHistory::WasRestoredFromHistory(
const content::DownloadItem* download) const {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
const DownloadHistoryData* data = DownloadHistoryData::Get(download);
// The OnDownloadCreated handler sets the was_restored_from_history flag when
@@ -253,7 +253,7 @@ bool DownloadHistory::WasRestoredFromHistory(
}
void DownloadHistory::QueryCallback(scoped_ptr<InfoVector> infos) {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
// ManagerGoingDown() may have happened before the history loaded.
if (!notifier_.GetManager())
return;
@@ -293,7 +293,7 @@ void DownloadHistory::QueryCallback(scoped_ptr<InfoVector> infos) {
}
void DownloadHistory::MaybeAddToHistory(content::DownloadItem* item) {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
uint32 download_id = item->GetId();
DownloadHistoryData* data = DownloadHistoryData::Get(item);
@@ -371,7 +371,7 @@ void DownloadHistory::ItemAdded(uint32 download_id, bool success) {
void DownloadHistory::OnDownloadCreated(
content::DownloadManager* manager, content::DownloadItem* item) {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
// All downloads should pass through OnDownloadCreated exactly once.
CHECK(!DownloadHistoryData::Get(item));
@@ -389,7 +389,7 @@ void DownloadHistory::OnDownloadCreated(
void DownloadHistory::OnDownloadUpdated(
content::DownloadManager* manager, content::DownloadItem* item) {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
DownloadHistoryData* data = DownloadHistoryData::Get(item);
if (data->state() == DownloadHistoryData::NOT_PERSISTED) {
@@ -424,7 +424,7 @@ void DownloadHistory::OnDownloadOpened(
void DownloadHistory::OnDownloadRemoved(
content::DownloadManager* manager, content::DownloadItem* item) {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
DownloadHistoryData* data = DownloadHistoryData::Get(item);
if (data->state() != DownloadHistoryData::PERSISTED) {
@@ -445,7 +445,7 @@ void DownloadHistory::OnDownloadRemoved(
}
void DownloadHistory::ScheduleRemoveDownload(uint32 download_id) {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
// For database efficiency, batch removals together if they happen all at
// once.
@@ -458,7 +458,7 @@ void DownloadHistory::ScheduleRemoveDownload(uint32 download_id) {
}
void DownloadHistory::RemoveDownloadsBatch() {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
IdSet remove_ids;
removing_ids_.swap(remove_ids);
history_->RemoveDownloads(remove_ids);
« no previous file with comments | « chrome/browser/download/download_crx_util.cc ('k') | chrome/browser/download/download_history_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698