Index: components/invalidation/impl/gcm_network_channel.cc |
diff --git a/components/invalidation/impl/gcm_network_channel.cc b/components/invalidation/impl/gcm_network_channel.cc |
index 033843c4ec2f8999febb1da5b6cc41ee6d7fada1..47b95b4dda26bad055e08a4efa09903abbcf18e0 100644 |
--- a/components/invalidation/impl/gcm_network_channel.cc |
+++ b/components/invalidation/impl/gcm_network_channel.cc |
@@ -21,6 +21,7 @@ |
#include "google_apis/gaia/google_service_auth_error.h" |
#include "net/base/load_flags.h" |
#include "net/http/http_status_code.h" |
+#include "net/traffic_annotation/network_traffic_annotation.h" |
#include "net/url_request/url_fetcher.h" |
#include "net/url_request/url_request_status.h" |
@@ -218,8 +219,45 @@ void GCMNetworkChannel::OnGetTokenComplete( |
access_token_ = token; |
DVLOG(2) << "Got access token, sending message"; |
- fetcher_ = net::URLFetcher::Create(BuildUrl(registration_id_), |
- net::URLFetcher::POST, this); |
+ net::NetworkTrafficAnnotationTag traffic_annotation = |
+ net::DefineNetworkTrafficAnnotation("invalidation_service", R"( |
+ semantics { |
+ sender: "Invalidation service" |
+ description: |
+ "Chromium uses cacheinvalidation library to receive push " |
+ "notifications from the server about sync items (bookmarks, " |
+ "passwords, preferences, etc.) modified on other clients. It uses " |
+ "GCMClient to receive incoming messages. This request is used for " |
+ "client-to-server communications." |
+ trigger: |
+ "The first message is sent to register client with the server on " |
+ "Chromium startup. It is then sent periodically to confirm that " |
+ "the client is still online. After receiving notification about " |
+ "server changes, the client sends this request to acknowledge that " |
+ "the notification is processed." |
+ data: |
+ "Different in each use case:\n" |
+ "- Initial registration: Doesn't contain user data.\n" |
+ "- Updating the set of subscriptions: Contains server generated " |
+ "client_token and ObjectIds identifying subscriptions. ObjectId " |
+ "is not unique to user.\n" |
+ "- Invalidation acknowledgement: Contains client_token, ObjectId " |
+ "and server version for corresponding subscription. Version is not " |
+ "related to sync data, it is an internal concept of invalidations " |
+ "protocol." |
+ destination: GOOGLE_OWNED_SERVICE |
+ } |
+ policy { |
+ cookies_allowed: false |
+ setting: "This feature cannot be disabled." |
+ policy_exception_justification: |
+ "Not implemented. Disabling InvalidationService might break " |
+ "features that depend on it. It makes sense to control top level " |
+ "features that use InvalidationService." |
+ })"); |
+ fetcher_ = |
+ net::URLFetcher::Create(BuildUrl(registration_id_), net::URLFetcher::POST, |
+ this, traffic_annotation); |
data_use_measurement::DataUseUserData::AttachToFetcher( |
fetcher_.get(), data_use_measurement::DataUseUserData::INVALIDATION); |
fetcher_->SetRequestContext(request_context_getter_.get()); |