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

Side by Side Diff: components/safe_browsing_db/util.h

Issue 2233103002: Move full hash caching logic to v4_get_hash_protocol_manager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: unique_ptr for V4GetHasProtocolManager. Fix the lone failing unit test. Created 4 years, 3 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 unified diff | Download patch
OLDNEW
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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 }; 70 };
71 71
72 // Metadata that was returned by a GetFullHash call. This is the parsed version 72 // Metadata that was returned by a GetFullHash call. This is the parsed version
73 // of the PB (from Pver3, or Pver4 local) or JSON (from Pver4 via GMSCore). 73 // of the PB (from Pver3, or Pver4 local) or JSON (from Pver4 via GMSCore).
74 // Some fields are only applicable to certain lists. 74 // Some fields are only applicable to certain lists.
75 struct ThreatMetadata { 75 struct ThreatMetadata {
76 ThreatMetadata(); 76 ThreatMetadata();
77 ThreatMetadata(const ThreatMetadata& other); 77 ThreatMetadata(const ThreatMetadata& other);
78 ~ThreatMetadata(); 78 ~ThreatMetadata();
79 79
80 bool operator==(const ThreatMetadata& other) const;
81 bool operator!=(const ThreatMetadata& other) const;
82
80 // Type of blacklisted page. Used on malware and UwS lists. 83 // Type of blacklisted page. Used on malware and UwS lists.
81 // This will be NONE if it wasn't present in the reponse. 84 // This will be NONE if it wasn't present in the reponse.
82 ThreatPatternType threat_pattern_type; 85 ThreatPatternType threat_pattern_type;
83 86
84 // Set of permissions blocked. Used with threat_type API_ABUSE. 87 // Set of permissions blocked. Used with threat_type API_ABUSE.
85 // This will be empty if it wasn't present in the response. 88 // This will be empty if it wasn't present in the response.
86 std::set<std::string> api_permissions; 89 std::set<std::string> api_permissions;
87 90
88 // Opaque base64 string used for user-population experiments in pver4. 91 // Opaque base64 string used for user-population experiments in pver4.
89 // This will be empty if it wasn't present in the response. 92 // This will be empty if it wasn't present in the response.
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 // Generate the set of full hashes to check for |url|. If 197 // Generate the set of full hashes to check for |url|. If
195 // |include_whitelist_hashes| is true we will generate additional path-prefixes 198 // |include_whitelist_hashes| is true we will generate additional path-prefixes
196 // to match against the csd whitelist. E.g., if the path-prefix /foo is on the 199 // to match against the csd whitelist. E.g., if the path-prefix /foo is on the
197 // whitelist it should also match /foo/bar which is not the case for all the 200 // whitelist it should also match /foo/bar which is not the case for all the
198 // other lists. We'll also always add a pattern for the empty path. 201 // other lists. We'll also always add a pattern for the empty path.
199 void UrlToFullHashes(const GURL& url, bool include_whitelist_hashes, 202 void UrlToFullHashes(const GURL& url, bool include_whitelist_hashes,
200 std::vector<SBFullHash>* full_hashes); 203 std::vector<SBFullHash>* full_hashes);
201 } // namespace safe_browsing 204 } // namespace safe_browsing
202 205
203 #endif // COMPONENTS_SAFE_BROWSING_DB_UTIL_H_ 206 #endif // COMPONENTS_SAFE_BROWSING_DB_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698