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

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

Issue 2697193003: Network traffic annotation added to safe_browsing (Closed)
Patch Set: nits 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..baf76f1d04bcaa161693288a9c3adf4421db4280 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,31 @@ void ThreatDetailsCacheCollector::OpenEntry() {
return;
}
- current_fetch_ = net::URLFetcher::Create(GURL(resources_it_->first),
- net::URLFetcher::GET, this);
+ net::NetworkTrafficAnnotationTag traffic_annotation =
+ net::DefineNetworkTrafficAnnotation("...", R"(
+ semantics {
+ sender: "..."
Nathan Parker 2017/02/23 01:16:53 This really isn't a network request, so I'm not su
Ramin Halavati 2017/02/23 08:18:24 I think we can add an annotation specifying this.
+ 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);

Powered by Google App Engine
This is Rietveld 408576698