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

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 updated. 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
« no previous file with comments | « google_apis/gaia/gaia_oauth_client.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..4d10e846cee5ca4b76b01d3ad8010a00236b7d7d 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,36 @@ 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: "OAuth 2.0 Access Token Fetcher"
+ description:
+ "This request is used by the Token Service to fetch an OAuth 2.0 "
+ "access token for a known Google account."
+ trigger:
+ "This request can be triggered at any moment when any service "
+ "requests an OAuth 2.0 access token from the Token Service."
+ data:
+ "Chrome OAuth 2.0 client id and secret, the set of OAuth 2.0 "
+ "scopes and the OAuth 2.0 refresh token."
+ destination: GOOGLE_OWNED_SERVICE
+ }
+ policy {
+ cookies_allowed: false
+ setting:
+ "This feature cannot be disabled in settings, but if user signs "
+ "out of Chrome, this request would not be made."
+ chrome_policy {
+ SigninAllowed {
+ policy_options {mode: MANDATORY}
+ SigninAllowed: false
+ }
+ }
+ })");
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);
« no previous file with comments | « google_apis/gaia/gaia_oauth_client.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698