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

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

Issue 1843663002: Add another feature flag which allows SuspiciousModule reports to be sent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 | chrome/browser/safe_browsing/incident_reporting/module_load_analyzer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc
diff --git a/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc b/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc
index 18f91f5effbcf14929154155adc245c226948529..49f2f77adfa41aee5ccd178af23d246110bd2f0b 100644
--- a/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc
+++ b/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc
@@ -10,6 +10,7 @@
#include <utility>
#include <vector>
+#include "base/feature_list.h"
#include "base/macros.h"
#include "base/metrics/field_trial.h"
#include "base/metrics/histogram.h"
@@ -42,6 +43,12 @@
namespace safe_browsing {
+// Enables reporting of suspicious modules loaded in the process. If this
+// feature is disabled, incidents get pruned instead of reported.
+extern const base::Feature kIncidentReportingSuspiciousModuleReporting{
grt (UTC plus 2) 2016/03/29 20:37:58 nit: omit extern? nit: space before { (unless git
+ "IncidentReportingSuspiciousModuleReporting",
+ base::FEATURE_DISABLED_BY_DEFAULT};
+
namespace {
// The action taken for an incident; used for user metrics (see
@@ -973,6 +980,12 @@ void IncidentReportingService::ProcessIncidentsIfCollectionComplete() {
// Drop the incident and mark for future pruning since no executable
// download was found.
transaction.MarkAsReported(state.type, state.key, state.digest);
+ } else if (incident->GetType() == IncidentType::SUSPICIOUS_MODULE &&
grt (UTC plus 2) 2016/03/29 20:37:58 can't say i like having the service know intimate
proberge 2016/03/29 20:47:10 Yeah, it's not great. We'll get rid of this piece
+ !base::FeatureList::IsEnabled(
+ kIncidentReportingSuspiciousModuleReporting)) {
+ LogIncidentDataType(PRUNED, *incident);
+ // Drop the incident and mark for future pruning.
+ transaction.MarkAsReported(state.type, state.key, state.digest);
} else {
LogIncidentDataType(ACCEPTED, *incident);
// Ownership of the payload is passed to the report.
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/incident_reporting/module_load_analyzer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698