Chromium Code Reviews| Index: chrome/browser/safe_browsing/notification_image_reporter.cc |
| diff --git a/chrome/browser/safe_browsing/notification_image_reporter.cc b/chrome/browser/safe_browsing/notification_image_reporter.cc |
| index 89499fabdf46edcc9bfa12113244d2c25fe43d0e..a57557516817b2f2ecafb60c8035dcd43d00416c 100644 |
| --- a/chrome/browser/safe_browsing/notification_image_reporter.cc |
| +++ b/chrome/browser/safe_browsing/notification_image_reporter.cc |
| @@ -43,13 +43,18 @@ const base::Feature kNotificationImageReporterFeature{ |
| const char kReportChance[] = "ReportChance"; |
| const char kDefaultMimeType[] = "image/png"; |
| -// Passed to ReportSender::Send as an ErrorCallback, so must take a GURL, but it |
| -// is unused. |
| -void LogReportResult(const GURL& url, int net_error) { |
| +// Passed to ReportSender::Send as an ErrorCallback. |
| +void LogReportErrorCallback(const GURL& url, int net_error) { |
| UMA_HISTOGRAM_SPARSE_SLOWLY("SafeBrowsing.NotificationImageReporter.NetError", |
| net_error); |
| } |
| +// Passed to ReportSender::Send as an SuccessCallback. |
| +void LogReportSuccessCallback(int response_code) { |
|
eroman
2017/04/25 21:02:39
Is it intentional that |response_code| is unused?
meacer
2017/04/25 22:19:07
I intentionally left it unused here, but I think S
|
| + UMA_HISTOGRAM_SPARSE_SLOWLY("SafeBrowsing.NotificationImageReporter.NetError", |
| + net::OK); |
| +} |
| + |
| } // namespace |
| const char NotificationImageReporter::kReportingUploadUrl[] = |
| @@ -216,10 +221,9 @@ void NotificationImageReporter::SendReportOnIO( |
| std::string serialized_report; |
| report.SerializeToString(&serialized_report); |
| - report_sender_->Send( |
| - GURL(kReportingUploadUrl), "application/octet-stream", serialized_report, |
| - base::Bind(&LogReportResult, GURL(kReportingUploadUrl), net::OK), |
| - base::Bind(&LogReportResult)); |
| + report_sender_->Send(GURL(kReportingUploadUrl), "application/octet-stream", |
| + serialized_report, base::Bind(&LogReportSuccessCallback), |
| + base::Bind(&LogReportErrorCallback)); |
| // TODO(johnme): Consider logging bandwidth and/or duration to UMA. |
| } |