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

Unified Diff: google_apis/gcm/engine/registration_request.cc

Issue 2737433002: Network traffic annotation added to goolge_apis/gcm/engine. (Closed)
Patch Set: Wrong files removed. 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 | « google_apis/gcm/engine/checkin_request.cc ('k') | google_apis/gcm/engine/unregistration_request.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: google_apis/gcm/engine/registration_request.cc
diff --git a/google_apis/gcm/engine/registration_request.cc b/google_apis/gcm/engine/registration_request.cc
index 386af0e7eab3f55967901e5e066684f10acaaf75..07c1c51c66e18118778f47467e8fe8e0ca3d90e4 100644
--- a/google_apis/gcm/engine/registration_request.cc
+++ b/google_apis/gcm/engine/registration_request.cc
@@ -20,6 +20,7 @@
#include "net/base/load_flags.h"
#include "net/http/http_request_headers.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_context_getter.h"
#include "net/url_request/url_request_status.h"
@@ -144,9 +145,36 @@ RegistrationRequest::~RegistrationRequest() {}
void RegistrationRequest::Start() {
DCHECK(!callback_.is_null());
DCHECK(!url_fetcher_.get());
-
- url_fetcher_ =
- net::URLFetcher::Create(registration_url_, net::URLFetcher::POST, this);
+ net::NetworkTrafficAnnotationTag traffic_annotation =
+ net::DefineNetworkTrafficAnnotation("gcm_registration", R"(
+ semantics {
+ sender: "GCM Driver"
+ description:
+ "Chromium interacts with Google Cloud Messaging to receive push "
+ "messages for various browser features, as well as on behalf of "
+ "websites and extensions. This requests Google Cloud Messaging to "
+ "create a new subscription through which messages can be sent to "
+ "the registering entity, through Chromium."
+ trigger:
+ "Immediately after a feature, website or extension creates a new "
+ "registration with the GCM Driver."
Dmitry Titov 2017/03/18 01:27:12 Not sure if it makes any difference, but it can be
Peter Beverloo 2017/03/21 00:18:46 I think that'd be a good addition. Let me send you
+ data:
+ "The profile-bound Android ID and associated secret, and the "
+ "identifiers for the feature, website or extension that is "
+ "creating the registration."
+ destination: GOOGLE_OWNED_SERVICE
+ }
+ policy {
+ cookies_allowed: false
+ setting:
+ "Support for interacting with Google Cloud Messaging is enabled by "
+ "default, and there is no configuration option to completely "
+ "disable it."
+ policy_exception_justification:
+ "Not implemented, considered not useful."
+ })");
+ url_fetcher_ = net::URLFetcher::Create(
+ registration_url_, net::URLFetcher::POST, this, traffic_annotation);
url_fetcher_->SetRequestContext(request_context_getter_.get());
url_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES |
net::LOAD_DO_NOT_SAVE_COOKIES);
« no previous file with comments | « google_apis/gcm/engine/checkin_request.cc ('k') | google_apis/gcm/engine/unregistration_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698