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 d122732e25b60d1afaa51ab881b94edf5da064be..28eb89de6fb22ddfc63aabc98a19c7062d13f400 100644 |
--- a/chrome/browser/safe_browsing/client_side_detection_service.cc |
+++ b/chrome/browser/safe_browsing/client_side_detection_service.cc |
@@ -261,7 +261,7 @@ void ClientSideDetectionService::StartClientReportPhishingRequest( |
scoped_ptr<ClientReportPhishingRequestCallback> cb(callback); |
std::string request_data; |
- if (!request->SerializeToString(&request_data)) { |
+ if (!request->SerializeToString(&request_data) && cb.get()) { |
Brian Ryner
2011/07/19 21:27:10
This doesn't seem quite right -- don't we want to
noelutz
2011/07/19 22:28:08
Done.
|
UMA_HISTOGRAM_COUNTS("SBClientPhishing.RequestNotSerialized", 1); |
VLOG(1) << "Unable to serialize the CSD request. Proto file changed?"; |
cb->Run(GURL(request->url()), false); |
@@ -336,17 +336,20 @@ void ClientSideDetectionService::HandlePhishingVerdict( |
const std::string& data) { |
ClientPhishingResponse response; |
scoped_ptr<ClientReportInfo> info(client_phishing_reports_[source]); |
+ bool isphishing = false; |
Garrett Casto
2011/07/19 21:18:48
is_phishing?
mattm
2011/07/19 21:25:55
nit: is_phishing
noelutz
2011/07/19 22:28:08
Done.
noelutz
2011/07/19 22:28:08
Done.
|
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()); |
+ isphishing = 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, isphishing); |
} |
client_phishing_reports_.erase(source); |
delete source; |