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

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

Issue 2648713002: Add response code to the success callback of ReportSender (Closed)
Patch Set: Remove response code from error callback Created 3 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/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.
}

Powered by Google App Engine
This is Rietveld 408576698