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

Unified Diff: components/safe_browsing/base_ping_manager.cc

Issue 2801643002: Network traffic annotation added to base_ping_manager. (Closed)
Patch Set: Commets addressed. 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 | « components/safe_browsing/DEPS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/safe_browsing/base_ping_manager.cc
diff --git a/components/safe_browsing/base_ping_manager.cc b/components/safe_browsing/base_ping_manager.cc
index ed54971a028be7cff61ea957006193ee43231b1b..80f846672b23bfac02c6d4fe595b059493ac61ed 100644
--- a/components/safe_browsing/base_ping_manager.cc
+++ b/components/safe_browsing/base_ping_manager.cc
@@ -18,6 +18,7 @@
#include "net/base/escape.h"
#include "net/base/load_flags.h"
#include "net/log/net_log_source_type.h"
+#include "net/traffic_annotation/network_traffic_annotation.h"
#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_getter.h"
@@ -56,6 +57,39 @@ std::unique_ptr<base::Value> NetLogPingEndCallback(
return std::move(event_params);
}
+net::NetworkTrafficAnnotationTag kTrafficAnnotation =
+ net::DefineNetworkTrafficAnnotation("safe_browsing_extended_reporting", R"(
+ semantics {
+ sender: "Safe Browsing Extended Reporting"
+ description:
+ "When a user is opted in to automatically reporting 'possible "
+ "security incidents to Google,' and they reach a bad page that's "
+ "flagged by Safe Browsing, Chrome will send a report to Google "
+ "with information about the threat. This helps Safe Browsing learn "
+ "where threats originate and thus protect more users."
+ trigger:
+ "When an red interstitial is show, and the user is opted-in."
msramek 2017/05/04 10:56:15 typo: s/an/a/
Ramin Halavati 2017/05/05 07:07:08 Done.
+ data:
+ "URLs and referrers from from the page along with other security-"
msramek 2017/05/04 10:56:15 Nathan, the plural (URLs) means URLs of subresourc
Nathan Parker 2017/05/04 15:44:43 Sure, how about: data: The report includes the UR
Ramin Halavati 2017/05/05 07:07:08 Done.
+ "relevant data from the page contents."
+ destination: GOOGLE_OWNED_SERVICE
+ }
+ policy {
+ cookies_allowed: true
+ cookies_store: "Safe Browsing Cookie Store"
+ setting:
+ "Users can enable or disable this feature by toggling "
+ "'Automatically report details of possible security incidents to "
+ "Google' in Chrome's settings under 'Privcay'. The feature is "
msramek 2017/05/04 10:56:16 typo: Privacy
Ramin Halavati 2017/05/05 07:07:08 Done.
+ "enabled by default."
Nathan Parker 2017/05/04 15:44:43 The feature is DISABLED by default.
Ramin Halavati 2017/05/05 07:07:08 Done.
+ chrome_policy {
+ SafeBrowsingExtendedReportingOptInAllowed {
+ policy_options {mode: MANDATORY}
+ SafeBrowsingExtendedReportingOptInAllowed: false
+ }
+ }
+ })");
+
} // namespace
namespace safe_browsing {
@@ -113,7 +147,7 @@ void BasePingManager::ReportSafeBrowsingHit(
report_url,
hit_report.post_data.empty() ? net::URLFetcher::GET
: net::URLFetcher::POST,
- this);
+ this, kTrafficAnnotation);
net::URLFetcher* report = report_ptr.get();
data_use_measurement::DataUseUserData::AttachToFetcher(
report, data_use_measurement::DataUseUserData::SAFE_BROWSING);
@@ -137,8 +171,8 @@ void BasePingManager::ReportSafeBrowsingHit(
// Sends threat details for users who opt-in.
void BasePingManager::ReportThreatDetails(const std::string& report) {
GURL report_url = ThreatDetailsUrl();
- std::unique_ptr<net::URLFetcher> fetcher =
- net::URLFetcher::Create(report_url, net::URLFetcher::POST, this);
+ std::unique_ptr<net::URLFetcher> fetcher = net::URLFetcher::Create(
+ report_url, net::URLFetcher::POST, this, kTrafficAnnotation);
data_use_measurement::DataUseUserData::AttachToFetcher(
fetcher.get(), data_use_measurement::DataUseUserData::SAFE_BROWSING);
fetcher->SetLoadFlags(net::LOAD_DISABLE_CACHE);
« no previous file with comments | « components/safe_browsing/DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698