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

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: 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..8d8c07ae52802655622a5373d540367db2783b6f 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("...", R"(
Marc Treib 2017/03/10 10:47:56 safe_search_api
Ramin Halavati 2017/03/10 11:23:34 Done.
+ semantics {
+ sender: "..."
Marc Treib 2017/03/10 10:47:56 "SafeSearch API"? (That's really the target rather
Ramin Halavati 2017/03/10 11:23:34 What about 'Safe Search URL Checker'?
Marc Treib 2017/03/10 11:39:20 Yup, that sounds good!
+ description: "..."
Marc Treib 2017/03/10 10:47:56 Checks whether a given URL (or set of URLs) is con
Ramin Halavati 2017/03/10 11:23:34 Done.
+ trigger: "..."
+ data: "..."
Marc Treib 2017/03/10 10:47:56 URL(s) to be checked.
+ destination: WEBSITE/GOOGLE_OWNED_SERVICE/OTHER
Marc Treib 2017/03/10 10:47:56 GOOGLE_OWNED_SERVICE
Ramin Halavati 2017/03/10 11:23:34 Done.
+ }
+ policy {
+ cookies_allowed: false/true
Marc Treib 2017/03/10 10:47:56 false
Ramin Halavati 2017/03/10 11:23:34 Done.
+ cookies_store: "..."
Marc Treib 2017/03/10 10:47:56 n/a
Ramin Halavati 2017/03/10 11:23:34 Done.
+ setting: "..."
Marc Treib 2017/03/10 10:47:56 Right now, this functionality is only used for chi
Ramin Halavati 2017/03/10 11:23:34 Acknowledged.
+ chrome_policy {
+ [POLICY_NAME] {
+ policy_options {mode: MANDATORY/RECOMMENDED/UNSET}
+ [POLICY_NAME]: ... //(value to disable it)
+ }
+ }
Ramin Halavati 2017/03/10 11:23:34 Do these two policies have any effect on this feat
Marc Treib 2017/03/10 11:39:20 No, they're unrelated. Those (force-)enable SafeSe
+ 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