OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 // Utilities for the SafeBrowsing DB code. | 5 // Utilities for the SafeBrowsing DB code. |
6 | 6 |
7 #ifndef COMPONENTS_SAFE_BROWSING_DB_UTIL_H_ | 7 #ifndef COMPONENTS_SAFE_BROWSING_DB_UTIL_H_ |
8 #define COMPONENTS_SAFE_BROWSING_DB_UTIL_H_ | 8 #define COMPONENTS_SAFE_BROWSING_DB_UTIL_H_ |
9 | 9 |
10 #include <stdint.h> | 10 #include <stdint.h> |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 NONE, // Pattern type didn't appear in the metadata | 58 NONE, // Pattern type didn't appear in the metadata |
59 LANDING, // The match is a landing page | 59 LANDING, // The match is a landing page |
60 DISTRIBUTION, // The match is a distribution page | 60 DISTRIBUTION, // The match is a distribution page |
61 }; | 61 }; |
62 | 62 |
63 // Metadata that was returned by a GetFullHash call. This is the parsed version | 63 // Metadata that was returned by a GetFullHash call. This is the parsed version |
64 // of the PB (from Pver3, or Pver4 local) or JSON (from Pver4 via GMSCore). | 64 // of the PB (from Pver3, or Pver4 local) or JSON (from Pver4 via GMSCore). |
65 // Some fields are only applicable to certain lists. | 65 // Some fields are only applicable to certain lists. |
66 struct ThreatMetadata { | 66 struct ThreatMetadata { |
67 ThreatMetadata(); | 67 ThreatMetadata(); |
| 68 ThreatMetadata(const ThreatMetadata& other); |
68 ~ThreatMetadata(); | 69 ~ThreatMetadata(); |
69 | 70 |
70 // Type of blacklisted page. Used on malware and UwS lists. | 71 // Type of blacklisted page. Used on malware and UwS lists. |
71 // This will be NONE if it wasn't present in the reponse. | 72 // This will be NONE if it wasn't present in the reponse. |
72 ThreatPatternType threat_pattern_type; | 73 ThreatPatternType threat_pattern_type; |
73 | 74 |
74 // List of permissions blocked. Used with threat_type API_ABUSE. | 75 // List of permissions blocked. Used with threat_type API_ABUSE. |
75 // This will be empty if it wasn't present in the response. | 76 // This will be empty if it wasn't present in the response. |
76 std::vector<std::string> api_permissions; | 77 std::vector<std::string> api_permissions; |
77 | 78 |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 | 206 |
206 // Given a URL, returns all the paths we need to check. | 207 // Given a URL, returns all the paths we need to check. |
207 void GeneratePathsToCheck(const GURL& url, std::vector<std::string>* paths); | 208 void GeneratePathsToCheck(const GURL& url, std::vector<std::string>* paths); |
208 | 209 |
209 // Given a URL, returns all the patterns we need to check. | 210 // Given a URL, returns all the patterns we need to check. |
210 void GeneratePatternsToCheck(const GURL& url, std::vector<std::string>* urls); | 211 void GeneratePatternsToCheck(const GURL& url, std::vector<std::string>* urls); |
211 | 212 |
212 } // namespace safe_browsing | 213 } // namespace safe_browsing |
213 | 214 |
214 #endif // COMPONENTS_SAFE_BROWSING_DB_UTIL_H_ | 215 #endif // COMPONENTS_SAFE_BROWSING_DB_UTIL_H_ |
OLD | NEW |