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

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: Annotation updated. 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..2dd64bac0c1c6380513e61ea570592209745e507 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,32 @@ 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: "..."
Marc Treib 2017/03/10 11:39:20 Oh, this one is still missing. For child accounts
msramek 2017/03/14 16:13:02 The other usecase, for which I extracted this code
Ramin Halavati 2017/03/15 13:11:59 Done.
+ 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 "
msramek 2017/03/14 16:13:02 Shouldn't we mention the SU dashboard then?
Ramin Halavati 2017/03/15 13:11:59 Done.
+ "disabled by settings."
+ chrome_policy {
+ [POLICY_NAME] {
msramek 2017/03/14 16:13:02 Ramin, how do we want to handle these cases? The
Ramin Halavati 2017/03/15 13:11:59 As discussed, we will keep it free-form now and if
+ policy_options {mode: MANDATORY/RECOMMENDED/UNSET}
+ [POLICY_NAME]: ... //(value to disable it)
+ }
+ }
+ policy_exception_justification: "..."
+ })");
+ 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