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

Unified Diff: google_apis/gaia/oauth2_access_token_fetcher_impl.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_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..dd32485975c3475d9899d14aec028e93ba09d092 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,29 @@ static std::unique_ptr<URLFetcher> CreateFetcher(
const std::string& body,
URLFetcherDelegate* delegate) {
bool empty_body = body.empty();
+ net::NetworkTrafficAnnotationTag traffic_annotation =
+ net::DefineNetworkTrafficAnnotation("...", R"(
+ semantics {
+ sender: "..."
msarda 2017/05/03 09:03:53 OAuth2 Access Token Fetcher
Ramin Halavati 2017/05/03 09:45:07 Done.
+ description: "..."
msarda 2017/05/03 09:03:53 This request is used by the Token Service to fetch
Ramin Halavati 2017/05/03 09:45:07 Done.
+ trigger: "..."
msarda 2017/05/03 09:03:53 This request can be triggered at any moment when a
Ramin Halavati 2017/05/03 09:45:07 Done.
+ data: "..."
msarda 2017/05/03 09:03:54 The body of the request includes the following inf
Ramin Halavati 2017/05/03 09:45:07 Done.
+ destination: WEBSITE/GOOGLE_OWNED_SERVICE/OTHER
msarda 2017/05/03 09:03:53 GOOGLE_OWNED_SERVICE
Ramin Halavati 2017/05/03 09:45:07 Done.
+ }
+ policy {
+ cookies_allowed: false
+ setting: "..."
msarda 2017/05/03 09:03:53 This feature cannot be disabled in settings.
Ramin Halavati 2017/05/03 09:45:07 Done.
+ chrome_policy {
msarda 2017/05/03 09:03:54 Remove block.
Ramin Halavati 2017/05/03 09:45:07 Done.
+ [POLICY_NAME] {
+ policy_options {mode: MANDATORY/RECOMMENDED/UNSET}
+ [POLICY_NAME]: ... //(value to disable it)
+ }
+ }
+ policy_exception_justification: "..."
msarda 2017/05/03 09:03:54 "Not implemented. Disabling Oauth2 Access Token Fe
Ramin Halavati 2017/05/03 09:45:07 Done.
+ })");
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