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

Unified Diff: components/sync/driver/sync_stopped_reporter.cc

Issue 2707363004: Network traffic annotation added to sync. (Closed)
Patch Set: nits Created 3 years, 9 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 | components/sync/engine/net/http_bridge.cc » ('j') | components/sync/engine/net/http_bridge.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync/driver/sync_stopped_reporter.cc
diff --git a/components/sync/driver/sync_stopped_reporter.cc b/components/sync/driver/sync_stopped_reporter.cc
index 5dd869cb833bacf5f988a4346e27a819da9b18b8..9ffc43a964d67d4653e41773c3309bbbf6275981 100644
--- a/components/sync/driver/sync_stopped_reporter.cc
+++ b/components/sync/driver/sync_stopped_reporter.cc
@@ -13,6 +13,7 @@
#include "components/sync/protocol/sync.pb.h"
#include "net/base/load_flags.h"
#include "net/http/http_status_code.h"
+#include "net/traffic_annotation/network_traffic_annotation.h"
namespace {
@@ -61,8 +62,26 @@ void SyncStoppedReporter::ReportSyncStopped(const std::string& access_token,
std::string msg;
event_request.SerializeToString(&msg);
- fetcher_ =
- net::URLFetcher::Create(sync_event_url_, net::URLFetcher::POST, this);
+ net::NetworkTrafficAnnotationTag traffic_annotation =
+ net::DefineNetworkTrafficAnnotation("sync_stop_reporter", R"(
+ semantics {
+ sender: "Chrome Sync"
+ description:
+ "A network request to inform Chrome Sync that sync has been "
+ "disabled for this device."
+ trigger: "User disables sync."
+ data: "The sync device id and store birthday."
+ destination: GOOGLE_OWNED_SERVICE
+ }
+ policy {
+ cookies_allowed: false
+ setting: "This feature cannot be disabled by settings."
+ policy_exception_justification:
+ "Not required, this network request is only performed after the "
+ "user has opted in to sync and then disables sync."
+ })");
+ fetcher_ = net::URLFetcher::Create(sync_event_url_, net::URLFetcher::POST,
+ this, traffic_annotation);
fetcher_->AddExtraRequestHeader(base::StringPrintf(
"%s: Bearer %s", net::HttpRequestHeaders::kAuthorization,
access_token.c_str()));
« no previous file with comments | « no previous file | components/sync/engine/net/http_bridge.cc » ('j') | components/sync/engine/net/http_bridge.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698