Chromium Code Reviews| 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_); |