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

Unified Diff: components/image_fetcher/core/image_data_fetcher.cc

Issue 2794343002: Network traffic annotation added to image_data_fetcher. (Closed)
Patch Set: Created 3 years, 8 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/image_fetcher/core/image_data_fetcher.cc
diff --git a/components/image_fetcher/core/image_data_fetcher.cc b/components/image_fetcher/core/image_data_fetcher.cc
index 56078f7005509f873f7691bafa27b5da8432993d..df9fe24faaef1e91fb28685f271fa0e4508ef04d 100644
--- a/components/image_fetcher/core/image_data_fetcher.cc
+++ b/components/image_fetcher/core/image_data_fetcher.cc
@@ -9,6 +9,7 @@
#include "net/base/load_flags.h"
#include "net/http/http_response_headers.h"
#include "net/http/http_status_code.h"
+#include "net/traffic_annotation/network_traffic_annotation.h"
#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_request_context_getter.h"
#include "net/url_request/url_request_status.h"
@@ -65,8 +66,30 @@ void ImageDataFetcher::FetchImageData(
const ImageDataFetcherCallback& callback,
const std::string& referrer,
net::URLRequest::ReferrerPolicy referrer_policy) {
- std::unique_ptr<net::URLFetcher> url_fetcher = net::URLFetcher::Create(
- next_url_fetcher_id_++, image_url, net::URLFetcher::GET, this);
+ net::NetworkTrafficAnnotationTag traffic_annotation =
+ net::DefineNetworkTrafficAnnotation("...", R"(
+ semantics {
+ sender: "..."
markusheintz_ 2017/05/03 09:04:07 Is there a description of the fields? E.g. sender
+ description: "..."
+ trigger: "..."
markusheintz_ 2017/05/03 09:04:07 What do you expect here? This list of trigger is d
+ data: "..."
markusheintz_ 2017/05/03 09:04:07 raw image data is fetch for a given URL
+ destination: WEBSITE/GOOGLE_OWNED_SERVICE/OTHER
markusheintz_ 2017/05/03 09:04:07 It could be all of the options. Not sure how clien
+ }
+ policy {
+ cookies_allowed: false/true
markusheintz_ 2017/05/03 09:04:07 false.
+ cookies_store: "..."
markusheintz_ 2017/05/03 09:04:07 NA
+ setting: "..."
markusheintz_ 2017/05/03 09:04:07 none. clients have to do the right thing
+ chrome_policy {
markusheintz_ 2017/05/03 09:04:07 There exists no policy. It the responsibility of t
+ [POLICY_NAME] {
+ policy_options {mode: MANDATORY/RECOMMENDED/UNSET}
+ [POLICY_NAME]: ... //(value to disable it)
+ }
+ }
+ policy_exception_justification: "..."
+ })");
+ std::unique_ptr<net::URLFetcher> url_fetcher =
+ net::URLFetcher::Create(next_url_fetcher_id_++, image_url,
+ net::URLFetcher::GET, this, traffic_annotation);
DataUseUserData::AttachToFetcher(url_fetcher.get(), data_use_service_name_);
« 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