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

Unified Diff: chrome/browser/safe_search_api/safe_search_url_checker.cc

Issue 2743923002: Network traffic annotation added to safe_search_url_checker. (Closed)
Patch Set: nits Created 3 years, 9 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: chrome/browser/safe_search_api/safe_search_url_checker.cc
diff --git a/chrome/browser/safe_search_api/safe_search_url_checker.cc b/chrome/browser/safe_search_api/safe_search_url_checker.cc
index 16dda018fcc8324bbc82d50720c0f966a51d859b..17fdafd56763d67b85beaad7564828aecb186014 100644
--- a/chrome/browser/safe_search_api/safe_search_url_checker.cc
+++ b/chrome/browser/safe_search_api/safe_search_url_checker.cc
@@ -20,6 +20,7 @@
#include "google_apis/google_api_keys.h"
#include "net/base/escape.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_request_context.h"
#include "url/url_constants.h"
@@ -49,8 +50,29 @@ std::unique_ptr<net::URLFetcher> CreateFetcher(URLFetcherDelegate* delegate,
URLRequestContextGetter* context,
const std::string& api_key,
const GURL& url) {
- std::unique_ptr<net::URLFetcher> fetcher =
- URLFetcher::Create(0, GURL(kApiUrl), URLFetcher::POST, delegate);
+ net::NetworkTrafficAnnotationTag traffic_annotation =
+ net::DefineNetworkTrafficAnnotation("safe_search_api", R"(
+ semantics {
+ sender: "SafeSearch API"
+ description:
+ "Checks whether a given URL (or set of URLs) is considered safe by "
+ "Google SafeSearch."
+ trigger:
+ "If the parent enabled this feature for the child account, this is "
+ "sent for every navigation."
+ data: "URL(s) to be checked."
+ destination: GOOGLE_OWNED_SERVICE
+ }
+ policy {
+ cookies_allowed: false
+ setting:
+ "This feature is only used in child accounts and cannot be "
+ "disabled by settings. Parent accounts can disable it in "
+ "Supervised Users dashboard."
Marc Treib 2017/03/16 09:05:38 s/Supervised Users/the family/ ("Supervised Users
Ramin Halavati 2017/03/16 12:28:07 Done.
+ policy_exception_justification: "Not implemented."
+ })");
+ std::unique_ptr<net::URLFetcher> fetcher = URLFetcher::Create(
+ 0, GURL(kApiUrl), URLFetcher::POST, delegate, traffic_annotation);
fetcher->SetUploadData(kDataContentType, BuildRequestData(api_key, url));
fetcher->SetRequestContext(context);
fetcher->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES |
« 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