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

Unified Diff: components/ntp_snippets/remote/json_request.cc

Issue 2709483006: Network traffic annotation added to ntp_snippets. (Closed)
Patch Set: Created 3 years, 10 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 | « components/ntp_snippets/DEPS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ntp_snippets/remote/json_request.cc
diff --git a/components/ntp_snippets/remote/json_request.cc b/components/ntp_snippets/remote/json_request.cc
index c22e35c9ee9ec0f965fcab85b8c67cb1d03e8e53..fd445ef826c531a1545ed7c1d0ccf7b98b9629f2 100644
--- a/components/ntp_snippets/remote/json_request.cc
+++ b/components/ntp_snippets/remote/json_request.cc
@@ -30,6 +30,7 @@
#include "net/base/load_flags.h"
#include "net/http/http_response_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 "third_party/icu/source/common/unicode/uloc.h"
@@ -431,8 +432,29 @@ std::unique_ptr<net::URLFetcher> JsonRequest::Builder::BuildURLFetcher(
net::URLFetcherDelegate* delegate,
const std::string& headers,
const std::string& body) const {
- std::unique_ptr<net::URLFetcher> url_fetcher =
- net::URLFetcher::Create(url_, net::URLFetcher::POST, delegate);
+ net::NetworkTrafficAnnotationTag traffic_annotation =
+ net::DefineNetworkTrafficAnnotation("...", R"(
Marc Treib 2017/02/23 14:53:46 ntp_snippets_fetch
Ramin Halavati 2017/02/27 10:31:22 Done.
+ semantics {
+ sender: "..."
Marc Treib 2017/02/23 14:53:46 New Tab page content suggestions fetch
Ramin Halavati 2017/02/27 10:31:21 Done.
+ description: "..."
Marc Treib 2017/02/23 14:53:46 Google Chrome can show content suggestions (e.g. n
Ramin Halavati 2017/02/27 10:31:21 Done.
+ trigger: "..."
Marc Treib 2017/02/23 14:53:46 Triggered periodically in the background, or upon
Ramin Halavati 2017/02/27 10:31:21 Done.
+ data: "..."
Marc Treib 2017/02/23 14:53:46 The Chrome UI language, as well as a second langua
Ramin Halavati 2017/02/27 10:31:21 Done.
+ destination: WEBSITE/GOOGLE_OWNED_SERVICE/OTHER
Marc Treib 2017/02/23 14:53:46 GOOGLE_OWNED_SERVICE
Ramin Halavati 2017/02/27 10:31:21 Done.
+ }
+ policy {
+ cookies_allowed: false/true
Marc Treib 2017/02/23 14:53:46 false (I think? Not exactly sure what "cookies/cha
Ramin Halavati 2017/02/27 10:31:21 Yes, LoadFlags are set to not send or save cookie.
+ cookies_store: "..."
Marc Treib 2017/02/23 14:53:46 n/a
Ramin Halavati 2017/02/27 10:31:22 Done.
+ setting: "..."
Marc Treib 2017/02/23 14:53:46 n/a (though we might add one; see crbug.com/695129
Ramin Halavati 2017/02/27 10:31:21 Done.
+ policy {
+ [POLICY_NAME] {
Marc Treib 2017/02/23 14:53:46 NTPContentSuggestionsEnabled
Ramin Halavati 2017/02/27 10:31:21 Done.
+ policy_options {mode: MANDATORY/RECOMMENDED/UNSET}
Marc Treib 2017/02/23 14:53:46 Not sure what this means? Currently the policy is
Ramin Halavati 2017/02/27 10:31:21 Done.
+ value: ...
Marc Treib 2017/02/23 14:53:46 ?
Ramin Halavati 2017/02/27 10:31:21 It should be the value that disables this feature,
+ }
+ }
+ policy_exception_justification: "..."
+ })");
+ std::unique_ptr<net::URLFetcher> url_fetcher = net::URLFetcher::Create(
+ url_, net::URLFetcher::POST, delegate, traffic_annotation);
url_fetcher->SetRequestContext(url_request_context_getter_.get());
url_fetcher->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES |
net::LOAD_DO_NOT_SAVE_COOKIES);
« no previous file with comments | « components/ntp_snippets/DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698