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

Unified Diff: google_apis/gaia/oauth2_access_token_fetcher_impl.cc

Issue 2796293003: Network traffic annotation added to google_apis/gaia. (Closed)
Patch Set: Annotation moved to input argument. Created 3 years, 7 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_access_token_fetcher_impl.cc
diff --git a/google_apis/gaia/oauth2_access_token_fetcher_impl.cc b/google_apis/gaia/oauth2_access_token_fetcher_impl.cc
index 1393f5550bba9378609f243db918deb7453f0c57..ba13aec90b1e2201b38dcbb363cdc5bd449ca241 100644
--- a/google_apis/gaia/oauth2_access_token_fetcher_impl.cc
+++ b/google_apis/gaia/oauth2_access_token_fetcher_impl.cc
@@ -21,6 +21,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_fetcher.h"
#include "net/url_request/url_request_context_getter.h"
#include "net/url_request/url_request_status.h"
@@ -96,8 +97,32 @@ static std::unique_ptr<URLFetcher> CreateFetcher(
const std::string& body,
URLFetcherDelegate* delegate) {
bool empty_body = body.empty();
+ net::NetworkTrafficAnnotationTag traffic_annotation =
+ net::DefineNetworkTrafficAnnotation("oauth2_access_token_fetcher", R"(
+ semantics {
+ sender: "OAuth2 Access Token Fetcher"
+ description:
+ "This request is used by the Token Service to fetch an OAuth2 "
+ "access token for a known Google account."
+ trigger:
+ "This request can be triggered at any moment when any service "
+ "requests an OAuth2 access token from the Token Service."
+ data:
+ "Chrome OAuth2 client id and secret, the set of OAuth2 scopes and "
+ "the OAuth2 refresh token."
+ destination: GOOGLE_OWNED_SERVICE
+ }
+ policy {
+ cookies_allowed: false
+ setting: "This feature cannot be disabled in settings."
+ policy_exception_justification:
+ "Not implemented. Disabling Oauth2 Access Token Fetcher would "
+ "break features need access tokens (e.g. sync, chrome identity "
+ "API, etc)."
+ })");
std::unique_ptr<URLFetcher> result = net::URLFetcher::Create(
- 0, url, empty_body ? URLFetcher::GET : URLFetcher::POST, delegate);
+ 0, url, empty_body ? URLFetcher::GET : URLFetcher::POST, delegate,
+ traffic_annotation);
gaia::MarkURLFetcherAsGaia(result.get());
result->SetRequestContext(getter);

Powered by Google App Engine
This is Rietveld 408576698