Chromium Code Reviews| Index: components/safe_browsing_db/v4_protocol_manager_util.h |
| diff --git a/components/safe_browsing_db/v4_protocol_manager_util.h b/components/safe_browsing_db/v4_protocol_manager_util.h |
| index 4970f07eb18518a8b1b4a7613ecd1a2ac7da2808..3cadb0b147900e22dccd4093db593ad93b061596 100644 |
| --- a/components/safe_browsing_db/v4_protocol_manager_util.h |
| +++ b/components/safe_browsing_db/v4_protocol_manager_util.h |
| @@ -20,6 +20,7 @@ |
| namespace net { |
| class HttpRequestHeaders; |
| +class IPAddress; |
| } // namespace net |
| namespace safe_browsing { |
| @@ -136,6 +137,7 @@ struct ListIdentifier { |
| std::ostream& operator<<(std::ostream& os, const ListIdentifier& id); |
| PlatformType GetCurrentPlatformType(); |
| +const ListIdentifier GetAnyIpMalwareId(); |
| const ListIdentifier GetChromeUrlApiId(); |
| const ListIdentifier GetChromeUrlClientIncidentId(); |
| const ListIdentifier GetChromeUrlMalwareId(); |
| @@ -272,6 +274,16 @@ class V4ProtocolManagerUtil { |
| static void SetClientInfoFromConfig(ClientInfo* client_info, |
| const V4ProtocolConfig& config); |
| + static bool GetIPV6AddressFromString(const std::string& ip_address, |
|
Nathan Parker
2016/11/15 00:54:46
Is this used anywhere besides the function below?
vakh (use Gerrit instead)
2016/11/15 01:03:41
safe_browsing_database.cc
|
| + net::IPAddress* address); |
| + |
| + // Converts a IPV4 or IPV6 address in |ip_address| to the SHA1 hash of the |
| + // corresponding packed IPV6 address in |hashed_encoded_ip|, and adds an |
| + // extra byte containing the value 128 at the end. This is done to match the |
| + // server implementation for calculating the hash prefix of an IP address. |
| + static bool IPAddressToEncodedIPV6Hash(const std::string& ip_address, |
| + FullHash* hashed_encoded_ip); |
| + |
| private: |
| V4ProtocolManagerUtil(){}; |
| FRIEND_TEST_ALL_PREFIXES(V4ProtocolManagerUtilTest, TestBackOffLogic); |