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

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

Issue 2697193003: Network traffic annotation added to safe_browsing (Closed)
Patch Set: Unittests updated. 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..5b0548da3e47ca3b64c73d1239b4fb1f3dae55a2 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,38 @@ void ThreatDetailsCacheCollector::OpenEntry() {
return;
}
- current_fetch_ = net::URLFetcher::Create(GURL(resources_it_->first),
- net::URLFetcher::GET, this);
+ net::NetworkTrafficAnnotationTag traffic_annotation =
+ net::DefineNetworkTrafficAnnotation("safe_browsing_cache_collector", R"(
+ semantics {
+ sender: "Threat Details Cache Collector"
+ description:
+ "This request fetches differnt items from safe browsing cache "
+ "and DOES NOT make an actual network request."
+ trigger:
+ "When safe browsing extended report is collecting data."
+ data:
+ "None"
+ destination: OTHER
+ }
+ policy {
+ cookies_allowed: false
+ setting:
+ "Users can enable or disable this feature by stopping sending "
+ "security incident reports to Google via disabling 'Automatically "
+ "report details of possible security incdients to Google.' in "
+ "Chrome's settings under Advanced Settings, Privacy. The feature "
+ "is enabled by default."
Nathan Parker 2017/03/06 17:48:54 is disabled by default
Ramin Halavati 2017/03/07 08:24:47 Done.
+ policy {
+ SafeBrowsingExtendedReportingOptInAllowed {
+ policy_options {mode: MANDATORY}
+ value: false
Nathan Parker 2017/03/06 17:48:54 I'm not sure what "false" means in this context.
Ramin Halavati 2017/03/07 08:24:47 Here we need the value that disables the feature,
+ }
+ }
+ })");
+
+ 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