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

Unified Diff: chrome/browser/safe_browsing/malware_details_cache.cc

Issue 1060033003: [chrome/browser/safe_browsing] favor DCHECK_CURRENTLY_ON for better logs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed unit test break now 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/safe_browsing/malware_details_cache.cc
diff --git a/chrome/browser/safe_browsing/malware_details_cache.cc b/chrome/browser/safe_browsing/malware_details_cache.cc
index d97d99180bfcc9beddce91befcc5bbe410378d20..dc5fbc54b4464cc4047f2a7669993a3384580f87 100644
--- a/chrome/browser/safe_browsing/malware_details_cache.cc
+++ b/chrome/browser/safe_browsing/malware_details_cache.cc
@@ -56,7 +56,7 @@ void MalwareDetailsCacheCollector::StartCacheCollection(
}
bool MalwareDetailsCacheCollector::HasStarted() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
return has_started_;
}
@@ -64,7 +64,7 @@ MalwareDetailsCacheCollector::~MalwareDetailsCacheCollector() {}
// Fetch a URL and advance to the next one when done.
void MalwareDetailsCacheCollector::OpenEntry() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
DVLOG(1) << "OpenEntry";
if (resources_it_ == resources_->end()) {
@@ -100,7 +100,7 @@ ClientMalwareReportRequest::Resource* MalwareDetailsCacheCollector::GetResource(
void MalwareDetailsCacheCollector::OnURLFetchComplete(
const net::URLFetcher* source) {
DVLOG(1) << "OnUrlFetchComplete";
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
DCHECK(current_fetch_.get());
if (source->GetStatus().status() != net::URLRequestStatus::SUCCESS &&
source->GetStatus().error() == net::ERR_CACHE_MISS) {
@@ -139,7 +139,7 @@ void MalwareDetailsCacheCollector::ReadResponse(
ClientMalwareReportRequest::Resource* pb_resource,
const net::URLFetcher* source) {
DVLOG(1) << "ReadResponse";
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
net::HttpResponseHeaders* headers = source->GetResponseHeaders();
if (!headers) {
DVLOG(1) << "Missing response headers.";
@@ -172,7 +172,7 @@ void MalwareDetailsCacheCollector::ReadData(
ClientMalwareReportRequest::Resource* pb_resource,
const std::string& data) {
DVLOG(1) << "ReadData";
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
ClientMalwareReportRequest::HTTPResponse* pb_response =
pb_resource->mutable_response();
if (data.size() <= kMaxBodySizeBytes) { // Only send small bodies for now.
@@ -184,7 +184,7 @@ void MalwareDetailsCacheCollector::ReadData(
void MalwareDetailsCacheCollector::AdvanceEntry() {
DVLOG(1) << "AdvanceEntry";
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
// Advance to the next resource.
++resources_it_;
current_fetch_.reset(NULL);
@@ -197,7 +197,7 @@ void MalwareDetailsCacheCollector::AdvanceEntry() {
void MalwareDetailsCacheCollector::AllDone(bool success) {
DVLOG(1) << "AllDone";
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
*result_ = success;
BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, callback_);
callback_.Reset();
« no previous file with comments | « chrome/browser/safe_browsing/download_protection_service.cc ('k') | chrome/browser/safe_browsing/malware_details_history.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698