Chromium Code Reviews| Index: chrome/browser/safe_browsing/incident_reporting_service.cc |
| diff --git a/chrome/browser/safe_browsing/incident_reporting_service.cc b/chrome/browser/safe_browsing/incident_reporting_service.cc |
| index 51df03baefa9d89c06865476b223b2f8c789fb0f..91f29be66764963f06b1d09dc0c752742029532a 100644 |
| --- a/chrome/browser/safe_browsing/incident_reporting_service.cc |
| +++ b/chrome/browser/safe_browsing/incident_reporting_service.cc |
| @@ -23,6 +23,7 @@ |
| #include "chrome/browser/chrome_notification_types.h" |
| #include "chrome/browser/prefs/tracked/tracked_preference_validation_delegate.h" |
| #include "chrome/browser/profiles/profile.h" |
| +#include "chrome/browser/safe_browsing/binary_integrity_incident_handlers.h" |
| #include "chrome/browser/safe_browsing/database_manager.h" |
| #include "chrome/browser/safe_browsing/environment_data_collection.h" |
| #include "chrome/browser/safe_browsing/incident_report_uploader_impl.h" |
| @@ -45,6 +46,7 @@ enum IncidentType { |
| // Start with 1 rather than zero; otherwise there won't be enough buckets for |
| // the histogram. |
| TRACKED_PREFERENCE = 1, |
| + BINARY_INTEGRITY = 2, |
| // Values for new incident types go here. |
| NUM_INCIDENT_TYPES |
| }; |
| @@ -81,6 +83,8 @@ size_t CountIncidents(const ClientIncidentReport_IncidentData& incident) { |
| size_t result = 0; |
| if (incident.has_tracked_preference()) |
| ++result; |
| + if (incident.has_binary_integrity()) |
| + ++result; |
| // Add detection for new incident types here. |
| return result; |
| } |
| @@ -90,9 +94,11 @@ IncidentType GetIncidentType( |
| const ClientIncidentReport_IncidentData& incident_data) { |
| if (incident_data.has_tracked_preference()) |
| return TRACKED_PREFERENCE; |
| + if (incident_data.has_binary_integrity()) |
| + return BINARY_INTEGRITY; |
| // Add detection for new incident types here. |
| - COMPILE_ASSERT(TRACKED_PREFERENCE + 1 == NUM_INCIDENT_TYPES, |
| + COMPILE_ASSERT(TRACKED_PREFERENCE + 2 == NUM_INCIDENT_TYPES, |
|
mattm
2014/08/07 23:08:47
change to BINARY_INTEGRITY + 1?
grt (UTC plus 2)
2014/08/08 02:23:05
yes, please. below as well.
pmonette_google.com
2014/08/08 15:05:42
Done.
|
| add_support_for_new_types); |
| NOTREACHED(); |
| return NUM_INCIDENT_TYPES; |
| @@ -121,9 +127,13 @@ PersistentIncidentState ComputeIncidentState( |
| state.key = GetTrackedPreferenceIncidentKey(incident); |
| state.digest = GetTrackedPreferenceIncidentDigest(incident); |
| break; |
| + case BINARY_INTEGRITY: |
| + state.key = GetBinaryIntegrityIncidentKey(incident); |
| + state.digest = GetBinaryIntegrityIncidentDigest(incident); |
| + break; |
| // Add handling for new incident types here. |
| default: |
| - COMPILE_ASSERT(TRACKED_PREFERENCE + 1 == NUM_INCIDENT_TYPES, |
| + COMPILE_ASSERT(TRACKED_PREFERENCE + 2 == NUM_INCIDENT_TYPES, |
| add_support_for_new_types); |
| NOTREACHED(); |
| break; |