Index: chrome/browser/safe_browsing/threat_details_cache.cc |
diff --git a/chrome/browser/safe_browsing/threat_details_cache.cc b/chrome/browser/safe_browsing/threat_details_cache.cc |
index 066e06a332099be0f351cb17e7899ad338e2fbee..69ad2b068b3ac39b77c913a2d0f63b13fab9046e 100644 |
--- a/chrome/browser/safe_browsing/threat_details_cache.cc |
+++ b/chrome/browser/safe_browsing/threat_details_cache.cc |
@@ -21,6 +21,7 @@ |
#include "net/base/load_flags.h" |
#include "net/base/net_errors.h" |
#include "net/http/http_response_headers.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" |
@@ -81,8 +82,32 @@ void ThreatDetailsCacheCollector::OpenEntry() { |
return; |
} |
- current_fetch_ = net::URLFetcher::Create(GURL(resources_it_->first), |
- net::URLFetcher::GET, this); |
+ // Create traffic annotation tag. |
+ net::NetworkTrafficAnnotationTag traffic_annotation = |
+ net::DefineNetworkTrafficAnnotation("...", R"( |
+ semantics { |
+ sender: "..." |
+ description: "..." |
+ trigger: "..." |
+ data: "..." |
+ destination: WEBSITE/GOOGLE_OWNED_SERVICE/OTHER |
+ } |
+ policy { |
+ cookies_allowed: false/true |
+ cookies_store: "..." |
+ setting: "..." |
+ policy { |
+ [POLICY_NAME] { |
+ policy_options {mode: MANDATORY/RECOMMENDED/UNSET} |
+ value: ... |
+ } |
+ } |
+ policy_exception_justification: "..." |
+ })"); |
+ |
+ current_fetch_ = |
+ net::URLFetcher::Create(GURL(resources_it_->first), net::URLFetcher::GET, |
+ this, traffic_annotation); |
data_use_measurement::DataUseUserData::AttachToFetcher( |
current_fetch_.get(), |
data_use_measurement::DataUseUserData::SAFE_BROWSING); |