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

Unified Diff: chrome/browser/safe_browsing/client_side_detection_service.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/client_side_detection_service.cc
diff --git a/chrome/browser/safe_browsing/client_side_detection_service.cc b/chrome/browser/safe_browsing/client_side_detection_service.cc
index 09f44b96351a0713f5c357f503b983995b2fca6f..5dd332a3172e1a1c1ba1020dbcfb0abef7096f1f 100644
--- a/chrome/browser/safe_browsing/client_side_detection_service.cc
+++ b/chrome/browser/safe_browsing/client_side_detection_service.cc
@@ -119,12 +119,12 @@ ClientSideDetectionService::~ClientSideDetectionService() {
// static
ClientSideDetectionService* ClientSideDetectionService::Create(
net::URLRequestContextGetter* request_context_getter) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
return new ClientSideDetectionService(request_context_getter);
}
void ClientSideDetectionService::SetEnabledAndRefreshState(bool enabled) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
SendModelToRenderers(); // always refresh the renderer state
if (enabled == enabled_)
return;
@@ -167,7 +167,7 @@ void ClientSideDetectionService::SetEnabledAndRefreshState(bool enabled) {
void ClientSideDetectionService::SendClientReportPhishingRequest(
ClientPhishingRequest* verdict,
const ClientReportPhishingRequestCallback& callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
base::MessageLoop::current()->PostTask(
FROM_HERE,
base::Bind(&ClientSideDetectionService::StartClientReportPhishingRequest,
@@ -177,7 +177,7 @@ void ClientSideDetectionService::SendClientReportPhishingRequest(
void ClientSideDetectionService::SendClientReportMalwareRequest(
ClientMalwareRequest* verdict,
const ClientReportMalwareRequestCallback& callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
base::MessageLoop::current()->PostTask(
FROM_HERE,
base::Bind(&ClientSideDetectionService::StartClientReportMalwareRequest,
@@ -223,7 +223,7 @@ void ClientSideDetectionService::Observe(
int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(type == content::NOTIFICATION_RENDERER_PROCESS_CREATED);
if (!model_.get()) {
// Model might not be ready or maybe there was an error.
@@ -308,7 +308,7 @@ void ClientSideDetectionService::EndFetchModel(ClientModelStatus status) {
void ClientSideDetectionService::StartClientReportPhishingRequest(
ClientPhishingRequest* verdict,
const ClientReportPhishingRequestCallback& callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
scoped_ptr<ClientPhishingRequest> request(verdict);
if (!enabled_) {
@@ -349,7 +349,7 @@ void ClientSideDetectionService::StartClientReportPhishingRequest(
void ClientSideDetectionService::StartClientReportMalwareRequest(
ClientMalwareRequest* verdict,
const ClientReportMalwareRequestCallback& callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
scoped_ptr<ClientMalwareRequest> request(verdict);
if (!enabled_) {

Powered by Google App Engine
This is Rietveld 408576698