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

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

Issue 2737433002: Network traffic annotation added to goolge_apis/gcm/engine. (Closed)
Patch Set: 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
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..191066390c88d6564abc835c46eb3102d6a6c31d 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,29 @@ 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 =
Peter Beverloo 2017/03/15 18:58:04 Proposal (gcm_registration): semantics { sender
Ramin Halavati 2017/03/16 08:43:51 Done.
+ net::DefineNetworkTrafficAnnotation("...", R"(
+ semantics {
+ sender: "..."
+ description: "..."
+ trigger: "..."
+ data: "..."
+ destination: WEBSITE/GOOGLE_OWNED_SERVICE/OTHER
+ }
+ policy {
+ cookies_allowed: false/true
+ cookies_store: "..."
+ setting: "..."
+ policy {
+ [POLICY_NAME] {
+ policy_options {mode: MANDATORY/RECOMMENDED/UNSET}
+ [POLICY_NAME]: ... //(value to disable it)
+ }
+ }
+ policy_exception_justification: "..."
+ })");
+ 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);

Powered by Google App Engine
This is Rietveld 408576698