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

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

Issue 2703363002: Network traffic annotation added to NetMetricsLogUploader. (Closed)
Patch Set: nits 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..f1ff01e296ac230885ab85d5bc064f995a04a691 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,40 @@ 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. Usage statistics contain information such as preferences, "
+ "button clicks, and memory usage and do not include web page URLs "
+ "or personal information. See more at "
+ "https://www.google.com/chrome/browser/privacy/ under 'Usage "
+ "statistics and crash reports'."
+ trigger:
+ "Reports are automatically generated on startup and at intervals "
+ "while Chrome is running."
+ 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 "
battre 2017/02/24 07:59:33 by disabling
Ramin Halavati 2017/02/27 12:30:01 Done.
+ "'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