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

Unified Diff: content/browser/net/reporting_service_proxy.cc

Issue 2900553004: Reporting: Add histograms. (Closed)
Patch Set: oops, forgot about dependency Created 3 years, 7 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: content/browser/net/reporting_service_proxy.cc
diff --git a/content/browser/net/reporting_service_proxy.cc b/content/browser/net/reporting_service_proxy.cc
index 2e41335c11393e721213cd0c9043bcefc4bbe938..61dcf893f524e2b85cb1830563a48da65f9aeacc 100644
--- a/content/browser/net/reporting_service_proxy.cc
+++ b/content/browser/net/reporting_service_proxy.cc
@@ -15,6 +15,7 @@
#include "content/public/browser/site_instance.h"
#include "content/public/browser/storage_partition.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
+#include "net/reporting/reporting_report.h"
#include "net/reporting/reporting_service.h"
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_getter.h"
@@ -45,13 +46,17 @@ void QueueReportOnIOThread(
std::unique_ptr<const base::Value> body) {
net::URLRequestContext* request_context =
request_context_getter->GetURLRequestContext();
- if (!request_context)
+ if (!request_context) {
+ net::ReportingReport::RecordReportDiscardedForNoURLRequestContext();
return;
+ }
net::ReportingService* reporting_service =
request_context->reporting_service();
- if (!reporting_service)
+ if (!reporting_service) {
+ net::ReportingReport::RecordReportDiscardedForNoReportingService();
return;
+ }
// TODO(juliatuttle): Get rid of this copy.
reporting_service->QueueReport(url, group, type, body->CreateDeepCopy());
@@ -69,8 +74,10 @@ class ReportingServiceProxyImpl : public mojom::ReportingServiceProxy {
mojom::ReportingReportType type_enum,
std::unique_ptr<base::Value> body) override {
std::string type_string = ReportTypeEnumToString(type_enum);
- if (type_string.empty())
+ if (type_string.empty()) {
+ net::ReportingReport::RecordReportDiscardedForInvalidTypeFromRenderer();
return;
+ }
// TODO(juliatuttle): Get rid of this intermediate step.
const base::Value* raw_const_body = body.release();
« no previous file with comments | « no previous file | net/reporting/reporting_browsing_data_remover.cc » ('j') | tools/metrics/histograms/histograms.xml » ('J')

Powered by Google App Engine
This is Rietveld 408576698