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

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

Issue 2648713002: Add response code to the success callback of ReportSender (Closed)
Patch Set: eroman and estark comments 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..b9333b174df1f85eb86eb971305f7691ee57c5b6 100644
--- a/chrome/browser/safe_browsing/notification_image_reporter.cc
+++ b/chrome/browser/safe_browsing/notification_image_reporter.cc
@@ -24,6 +24,7 @@
#include "components/variations/variations_associated_data.h"
#include "content/public/browser/browser_thread.h"
#include "net/base/net_errors.h"
+#include "net/http/http_status_code.h"
#include "net/url_request/report_sender.h"
#include "skia/ext/image_operations.h"
#include "third_party/skia/include/core/SkBitmap.h"
@@ -45,7 +46,7 @@ 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) {
+void LogReportResult(const GURL& url, int net_error, int http_response_code) {
UMA_HISTOGRAM_SPARSE_SLOWLY("SafeBrowsing.NotificationImageReporter.NetError",
net_error);
}
@@ -216,10 +217,11 @@ 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(&LogReportResult, GURL(kReportingUploadUrl),
+ net::OK, net::HTTP_OK),
+ base::Bind(&LogReportResult));
// TODO(johnme): Consider logging bandwidth and/or duration to UMA.
}
« no previous file with comments | « chrome/browser/safe_browsing/mock_permission_report_sender.cc ('k') | chrome/browser/safe_browsing/permission_reporter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698