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

Unified Diff: chrome/browser/safe_browsing/incident_reporting/script_request_incident.cc

Issue 961483003: Throttle script request incidents to one per user. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/safe_browsing/incident_reporting/script_request_incident.cc
diff --git a/chrome/browser/safe_browsing/incident_reporting/script_request_incident.cc b/chrome/browser/safe_browsing/incident_reporting/script_request_incident.cc
index 6aa4598083b99c2ecf8fbd7af8e99663866e84f5..7f635ea1d67091e24da4f5e7e5010c2e2cb0c871 100644
--- a/chrome/browser/safe_browsing/incident_reporting/script_request_incident.cc
+++ b/chrome/browser/safe_browsing/incident_reporting/script_request_incident.cc
@@ -26,11 +26,14 @@ IncidentType ScriptRequestIncident::GetType() const {
}
std::string ScriptRequestIncident::GetKey() const {
- return payload()->script_request().script_digest();
+ // Use a static key in addition to a fixed digest below to ensure that only
+ // one incident per user is reported.
+ return "script_request_incident_key";
grt (UTC plus 2) 2015/02/26 03:21:37 i prefer simply "script_request_incident" so that
robertshield 2015/02/26 04:27:52 Those other preferences sound like jerks to me.
grt (UTC plus 2) 2015/02/26 04:47:18 Their mothers didn't raise them right.
}
uint32_t ScriptRequestIncident::ComputeDigest() const {
- // Return a constant to ensure that only one incident per digest is reported.
+ // Return a constant to ensure in addition to a fixed key above to ensure that
grt (UTC plus 2) 2015/02/26 03:21:37 please reduce the ensure-factor of this comment
robertshield 2015/02/26 04:27:52 You can never be too sure.
grt (UTC plus 2) 2015/02/26 04:47:18 Indubitably.
+ // only one incident per user is reported.
return 42;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698