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

Unified Diff: chrome/browser/safe_browsing/threat_details_cache.cc

Issue 2697193003: Network traffic annotation added to safe_browsing (Closed)
Patch Set: Created 3 years, 10 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
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);
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/two_phase_uploader.cc » ('j') | chrome/browser/safe_browsing/two_phase_uploader.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698