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

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

Issue 7408001: If we show a SafeBrowsing warning we always send the client-side detection (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Merge Created 9 years, 5 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 f9b984ad8fbdd3ef47eae10783bb4701976a5cf6..1605d0fe140319e27e399f8e2f944632adaf9d40 100644
--- a/chrome/browser/safe_browsing/client_side_detection_service.cc
+++ b/chrome/browser/safe_browsing/client_side_detection_service.cc
@@ -264,7 +264,9 @@ void ClientSideDetectionService::StartClientReportPhishingRequest(
if (!request->SerializeToString(&request_data)) {
UMA_HISTOGRAM_COUNTS("SBClientPhishing.RequestNotSerialized", 1);
VLOG(1) << "Unable to serialize the CSD request. Proto file changed?";
- cb->Run(GURL(request->url()), false);
+ if (cb.get()) {
+ cb->Run(GURL(request->url()), false);
+ }
return;
}
@@ -336,17 +338,20 @@ void ClientSideDetectionService::HandlePhishingVerdict(
const std::string& data) {
ClientPhishingResponse response;
scoped_ptr<ClientReportInfo> info(client_phishing_reports_[source]);
+ bool is_phishing = false;
if (status.is_success() && RC_REQUEST_OK == response_code &&
response.ParseFromString(data)) {
// Cache response, possibly flushing an old one.
cache_[info->phishing_url] =
make_linked_ptr(new CacheState(response.phishy(), base::Time::Now()));
- info->callback->Run(info->phishing_url, response.phishy());
+ is_phishing = response.phishy();
} else {
DLOG(ERROR) << "Unable to get the server verdict for URL: "
<< info->phishing_url << " status: " << status.status() << " "
<< "response_code:" << response_code;
- info->callback->Run(info->phishing_url, false);
+ }
+ if (info->callback.get()) {
+ info->callback->Run(info->phishing_url, is_phishing);
}
client_phishing_reports_.erase(source);
delete source;
« no previous file with comments | « chrome/browser/safe_browsing/client_side_detection_service.h ('k') | chrome/browser/safe_browsing/safe_browsing_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698