| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/safe_browsing/incident_reporting/incident_reporting_ser
vice.h" | 5 #include "chrome/browser/safe_browsing/incident_reporting/incident_reporting_ser
vice.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 if (incident_data.has_binary_integrity()) | 114 if (incident_data.has_binary_integrity()) |
| 115 return BINARY_INTEGRITY; | 115 return BINARY_INTEGRITY; |
| 116 if (incident_data.has_blacklist_load()) | 116 if (incident_data.has_blacklist_load()) |
| 117 return BLACKLIST_LOAD; | 117 return BLACKLIST_LOAD; |
| 118 if (incident_data.has_omnibox_interaction()) | 118 if (incident_data.has_omnibox_interaction()) |
| 119 return OMNIBOX_INTERACTION; | 119 return OMNIBOX_INTERACTION; |
| 120 if (incident_data.has_variations_seed_signature()) | 120 if (incident_data.has_variations_seed_signature()) |
| 121 return VARIATIONS_SEED_SIGNATURE; | 121 return VARIATIONS_SEED_SIGNATURE; |
| 122 | 122 |
| 123 // Add detection for new incident types here. | 123 // Add detection for new incident types here. |
| 124 COMPILE_ASSERT(VARIATIONS_SEED_SIGNATURE + 1 == NUM_INCIDENT_TYPES, | 124 static_assert(VARIATIONS_SEED_SIGNATURE + 1 == NUM_INCIDENT_TYPES, |
| 125 add_support_for_new_types); | 125 "support for new types must be added"); |
| 126 NOTREACHED(); | 126 NOTREACHED(); |
| 127 return NUM_INCIDENT_TYPES; | 127 return NUM_INCIDENT_TYPES; |
| 128 } | 128 } |
| 129 | 129 |
| 130 // Logs the type of incident in |incident_data| to a user metrics histogram. | 130 // Logs the type of incident in |incident_data| to a user metrics histogram. |
| 131 void LogIncidentDataType( | 131 void LogIncidentDataType( |
| 132 IncidentDisposition disposition, | 132 IncidentDisposition disposition, |
| 133 const ClientIncidentReport_IncidentData& incident_data) { | 133 const ClientIncidentReport_IncidentData& incident_data) { |
| 134 static const char* const kHistogramNames[] = { | 134 static const char* const kHistogramNames[] = { |
| 135 "SBIRS.ReceivedIncident", | 135 "SBIRS.ReceivedIncident", |
| (...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1015 if (!profile->IsOffTheRecord()) | 1015 if (!profile->IsOffTheRecord()) |
| 1016 OnProfileDestroyed(profile); | 1016 OnProfileDestroyed(profile); |
| 1017 break; | 1017 break; |
| 1018 } | 1018 } |
| 1019 default: | 1019 default: |
| 1020 break; | 1020 break; |
| 1021 } | 1021 } |
| 1022 } | 1022 } |
| 1023 | 1023 |
| 1024 } // namespace safe_browsing | 1024 } // namespace safe_browsing |
| OLD | NEW |