| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 // Datastructures that hold details of a Safe Browsing hit for reporting. | 5 // Datastructures that hold details of a Safe Browsing hit for reporting. |
| 6 | 6 |
| 7 #ifndef COMPONENTS_SAFE_BROWSING_DB_HIT_REPORT_H_ | 7 #ifndef COMPONENTS_SAFE_BROWSING_DB_HIT_REPORT_H_ |
| 8 #define COMPONENTS_SAFE_BROWSING_DB_HIT_REPORT_H_ | 8 #define COMPONENTS_SAFE_BROWSING_DB_HIT_REPORT_H_ |
| 9 | 9 |
| 10 #include "components/safe_browsing_db/util.h" | 10 #include "components/safe_browsing_db/util.h" |
| 11 #include "url/gurl.h" | 11 #include "url/gurl.h" |
| 12 | 12 |
| 13 namespace safe_browsing { | 13 namespace safe_browsing { |
| 14 | 14 |
| 15 // What service classified this threat as unsafe. | 15 // What service classified this threat as unsafe. |
| 16 enum class ThreatSource { | 16 enum class ThreatSource { |
| 17 UNKNOWN, | 17 UNKNOWN, |
| 18 DATA_SAVER, // From the Data Reduction service. | 18 DATA_SAVER, // From the Data Reduction service. |
| 19 LOCAL_PVER3, // From LocalSafeBrowingDatabaseManager, protocol v3 | 19 LOCAL_PVER3, // From LocalSafeBrowingDatabaseManager, protocol v3 |
| 20 LOCAL_PVER4, // From LocalSafeBrowingDatabaseManager, protocol v4 | 20 LOCAL_PVER4, // From LocalSafeBrowingDatabaseManager, protocol v4 |
| 21 REMOTE, // From RemoteSafeBrowingDatabaseManager | 21 REMOTE, // From RemoteSafeBrowingDatabaseManager |
| 22 CLIENT_SIDE_DETECTION, // From ClientSideDetectionHost | 22 CLIENT_SIDE_DETECTION, // From ClientSideDetectionHost |
| 23 }; | 23 }; |
| 24 | 24 |
| 25 // Data to report about the contents of a particular threat (malware, phishing, | 25 // Data to report about the contents of a particular threat (malware, phishing, |
| 26 // unsafe download URL). If post_data is non-empty, the request will be | 26 // unsafe download URL). If post_data is non-empty, the request will be |
| 27 // sent as a POST instead of a GET. | 27 // sent as a POST instead of a GET. |
| 28 struct HitReport { | 28 struct HitReport { |
| 29 HitReport(); | 29 HitReport(); |
| 30 HitReport(const HitReport& other); |
| 30 ~HitReport(); | 31 ~HitReport(); |
| 31 | 32 |
| 32 GURL malicious_url; | 33 GURL malicious_url; |
| 33 GURL page_url; | 34 GURL page_url; |
| 34 GURL referrer_url; | 35 GURL referrer_url; |
| 35 | 36 |
| 36 bool is_subresource; | 37 bool is_subresource; |
| 37 SBThreatType threat_type; | 38 SBThreatType threat_type; |
| 38 ThreatSource threat_source; | 39 ThreatSource threat_source; |
| 39 bool is_extended_reporting; | 40 bool is_extended_reporting; |
| 40 bool is_metrics_reporting_active; | 41 bool is_metrics_reporting_active; |
| 41 | 42 |
| 42 std::string post_data; | 43 std::string post_data; |
| 43 }; | 44 }; |
| 44 | 45 |
| 45 } // namespace safe_browsing | 46 } // namespace safe_browsing |
| 46 | 47 |
| 47 #endif // COMPONENTS_SAFE_BROWSING_DB_HIT_REPORT_H_ | 48 #endif // COMPONENTS_SAFE_BROWSING_DB_HIT_REPORT_H_ |
| OLD | NEW |