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

Unified Diff: components/metrics/net/net_metrics_log_uploader.cc

Issue 2703363002: Network traffic annotation added to NetMetricsLogUploader. (Closed)
Patch Set: Annotation updated. Created 3 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/metrics/net/net_metrics_log_uploader.cc
diff --git a/components/metrics/net/net_metrics_log_uploader.cc b/components/metrics/net/net_metrics_log_uploader.cc
index 5b2c95e5c141f27f57bfe1c4799ec1bc7f5c24a9..3897f4555cb16ca1e9f03c79357f774d4e88b370 100644
--- a/components/metrics/net/net_metrics_log_uploader.cc
+++ b/components/metrics/net/net_metrics_log_uploader.cc
@@ -7,6 +7,7 @@
#include "base/metrics/histogram_macros.h"
#include "components/data_use_measurement/core/data_use_user_data.h"
#include "net/base/load_flags.h"
+#include "net/traffic_annotation/network_traffic_annotation.h"
#include "net/url_request/url_fetcher.h"
#include "url/gurl.h"
@@ -26,8 +27,34 @@ NetMetricsLogUploader::~NetMetricsLogUploader() {
void NetMetricsLogUploader::UploadLog(const std::string& compressed_log_data,
const std::string& log_hash) {
- current_fetch_ =
- net::URLFetcher::Create(GURL(server_url_), net::URLFetcher::POST, this);
+ net::NetworkTrafficAnnotationTag traffic_annotation =
+ net::DefineNetworkTrafficAnnotation("metrics_report", R"(
+ semantics {
+ sender: "Metrics Log Uploader"
+ description:
+ "Report of usage statistics and crash-related data about Google "
+ "Chrome."
Ramin Halavati 2017/02/22 11:48:08 Would you like to add any details here, like examp
Steven Holte 2017/02/22 20:10:46 The best links might be this one: https://support
Ramin Halavati 2017/02/23 06:57:12 Thanks.
+ trigger: "Reports are automatically generated."
Ramin Halavati 2017/02/22 11:48:09 Would you like to add any occasion, interval, etc.
Steven Holte 2017/02/22 20:10:47 Currently the reports are generated on startup, an
Ramin Halavati 2017/02/23 06:57:12 Done.
+ data:
+ "A protocol buffer with usage statistics and crash related data."
+ destination: GOOGLE_OWNED_SERVICE
+ }
+ policy {
+ cookies_allowed: false
+ setting:
+ "Users can enable or disable this feature by stoping "
+ "'Automatically send usage statistics and crash reports to Google' "
+ "in Chrome's settings under Advanced Settings, Privacy. The "
+ "feature is enabled by default."
+ policy {
+ MetricsReportingEnabled {
+ policy_options {mode: MANDATORY}
+ value: false
+ }
+ }
+ })");
+ current_fetch_ = net::URLFetcher::Create(
+ GURL(server_url_), net::URLFetcher::POST, this, traffic_annotation);
data_use_measurement::DataUseUserData::AttachToFetcher(
current_fetch_.get(), data_use_measurement::DataUseUserData::UMA);
current_fetch_->SetRequestContext(request_context_getter_);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698