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

Unified Diff: components/search_engines/template_url_fetcher.cc

Issue 2711833003: Network traffic annotation added to template_url_fetcher. (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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/search_engines/template_url_fetcher.cc
diff --git a/components/search_engines/template_url_fetcher.cc b/components/search_engines/template_url_fetcher.cc
index cf972d0eeb915643151d183a8757c22f6fabeb78..cd8cec8a8f0cd0bec685dcb193d81825f938c470 100644
--- a/components/search_engines/template_url_fetcher.cc
+++ b/components/search_engines/template_url_fetcher.cc
@@ -13,11 +13,37 @@
#include "components/search_engines/template_url_parser.h"
#include "components/search_engines/template_url_service.h"
#include "net/base/load_flags.h"
+#include "net/traffic_annotation/network_traffic_annotation.h"
#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_fetcher_delegate.h"
#include "net/url_request/url_request_context_getter.h"
#include "net/url_request/url_request_status.h"
+namespace {
+// Traffic annotation for ReqeustDelegate
+constexpr net::NetworkTrafficAnnotationTag kTrafficAnnotation =
+ net::DefineNetworkTrafficAnnotation("...", R"(
vasilii 2017/02/24 14:42:38 open_search
Ramin Halavati 2017/02/24 14:57:56 Done.
+ semantics {
+ sender: "..."
vasilii 2017/02/24 14:42:38 open_search_fetcher
Ramin Halavati 2017/02/24 14:57:56 Done.
+ description: "..."
vasilii 2017/02/24 14:42:38 The web pages can include an OpenSearch descriptio
Ramin Halavati 2017/02/24 14:57:56 Done.
+ trigger: "..."
vasilii 2017/02/24 14:42:38 User visits a web page containing <link rel="sear
Ramin Halavati 2017/02/24 14:57:56 Done.
+ data: "..."
vasilii 2017/02/24 14:42:38 Nothing is uploaded.
Ramin Halavati 2017/02/24 14:57:56 Done.
+ destination: WEBSITE/GOOGLE_OWNED_SERVICE/OTHER
vasilii 2017/02/24 14:42:38 WEBSITE
Ramin Halavati 2017/02/24 14:57:57 Done.
+ }
+ policy {
+ cookies_allowed: false/true
vasilii 2017/02/24 14:42:38 true
Ramin Halavati 2017/02/24 14:57:56 Done.
+ cookies_store: "..."
vasilii 2017/02/24 14:42:38 user
Ramin Halavati 2017/02/24 14:57:56 Done.
+ setting: "..."
vasilii 2017/02/24 14:42:38 N/A
Ramin Halavati 2017/02/24 14:57:56 Done.
+ policy {
+ [POLICY_NAME] {
+ policy_options {mode: MANDATORY/RECOMMENDED/UNSET}
+ value: ...
+ }
+ }
+ policy_exception_justification: "..."
vasilii 2017/02/24 14:42:37 It's a web feature?
Ramin Halavati 2017/02/24 14:57:57 Done.
+ })");
+} // namespace
+
// RequestDelegate ------------------------------------------------------------
class TemplateURLFetcher::RequestDelegate : public net::URLFetcherDelegate {
public:
@@ -61,8 +87,10 @@ TemplateURLFetcher::RequestDelegate::RequestDelegate(
const GURL& osdd_url,
const GURL& favicon_url,
const URLFetcherCustomizeCallback& url_fetcher_customize_callback)
- : url_fetcher_(
- net::URLFetcher::Create(osdd_url, net::URLFetcher::GET, this)),
+ : url_fetcher_(net::URLFetcher::Create(osdd_url,
+ net::URLFetcher::GET,
+ this,
+ kTrafficAnnotation)),
fetcher_(fetcher),
keyword_(keyword),
osdd_url_(osdd_url),
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698