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

Unified Diff: components/search_engines/template_url_fetcher.cc

Issue 2711833003: Network traffic annotation added to template_url_fetcher. (Closed)
Patch Set: nits 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 bc74b092b99a606890af8f1ddecc7e74040f7fe5..0db1184388f9bf942e3b3a7008a90048686bf6cf 100644
--- a/components/search_engines/template_url_fetcher.cc
+++ b/components/search_engines/template_url_fetcher.cc
@@ -13,11 +13,39 @@
#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 RequestDelegate.
+constexpr net::NetworkTrafficAnnotationTag kTrafficAnnotation =
+ net::DefineNetworkTrafficAnnotation("open_search", R"(
+ semantics {
+ sender: "Omnibox"
+ description:
+ "Web pages can include an OpenSearch description doc in their HTML. "
+ "In this case Chromium downloads and parses the file. The "
+ "corresponding search engine is added to the list in the browser "
+ "settings (chrome://settings/searchEngines)."
+ trigger:
+ "User visits a web page containing a <link rel="search"> tag."
+ data: "None"
+ destination: WEBSITE
+ }
+ policy {
+ cookies_allowed: false
+ setting: "This feature cannot be disabled in settings."
+ policy_exception_justification:
+ "Not implemented, considered not useful as this feature does not "
+ "upload any data."
+ })");
+
+} // namespace
+
// RequestDelegate ------------------------------------------------------------
class TemplateURLFetcher::RequestDelegate : public net::URLFetcherDelegate {
public:
@@ -61,8 +89,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