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

Unified Diff: google_apis/gaia/oauth2_api_call_flow.cc

Issue 2796293003: Network traffic annotation added to google_apis/gaia. (Closed)
Patch Set: Created 3 years, 8 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/gaia/oauth2_api_call_flow.cc
diff --git a/google_apis/gaia/oauth2_api_call_flow.cc b/google_apis/gaia/oauth2_api_call_flow.cc
index e3d40f0e037e9c2a2164e764cb04bb56d758effe..7a55aa381e51c3ce083d4171b1fc4636eb47b34a 100644
--- a/google_apis/gaia/oauth2_api_call_flow.cc
+++ b/google_apis/gaia/oauth2_api_call_flow.cc
@@ -13,6 +13,7 @@
#include "net/base/escape.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_request_context_getter.h"
#include "net/url_request/url_request_status.h"
@@ -79,8 +80,28 @@ std::unique_ptr<URLFetcher> OAuth2ApiCallFlow::CreateURLFetcher(
const std::string& access_token) {
std::string body = CreateApiCallBody();
net::URLFetcher::RequestType request_type = GetRequestTypeForBody(body);
- std::unique_ptr<URLFetcher> result =
- net::URLFetcher::Create(0, CreateApiCallUrl(), request_type, this);
+ net::NetworkTrafficAnnotationTag traffic_annotation =
msarda 2017/05/03 09:03:54 I do not know what this fetcher is supposed to do.
Roger Tawa OOO till Jul 10th 2017/05/15 15:14:18 OAuth2ApiCallFlow helps write code to call google
Ramin Halavati 2017/05/16 05:26:02 What about adding NetworkTrafficAnnotation as an i
+ net::DefineNetworkTrafficAnnotation("...", R"(
+ semantics {
+ sender: "..."
+ description: "..."
+ trigger: "..."
+ data: "..."
+ destination: WEBSITE/GOOGLE_OWNED_SERVICE/OTHER
+ }
+ policy {
+ cookies_allowed: false
+ setting: "..."
+ chrome_policy {
+ [POLICY_NAME] {
+ policy_options {mode: MANDATORY/RECOMMENDED/UNSET}
+ [POLICY_NAME]: ... //(value to disable it)
+ }
+ }
+ policy_exception_justification: "..."
+ })");
+ std::unique_ptr<URLFetcher> result = net::URLFetcher::Create(
+ 0, CreateApiCallUrl(), request_type, this, traffic_annotation);
gaia::MarkURLFetcherAsGaia(result.get());
result->SetRequestContext(context);

Powered by Google App Engine
This is Rietveld 408576698