| Index: components/safe_browsing_db/v4_protocol_manager_util.cc
|
| diff --git a/components/safe_browsing_db/v4_protocol_manager_util.cc b/components/safe_browsing_db/v4_protocol_manager_util.cc
|
| index 5d2511551bff93aca15624094772c25f7ff5dcdc..4656d44270e2e30405541cca6b3ad7be416be523 100644
|
| --- a/components/safe_browsing_db/v4_protocol_manager_util.cc
|
| +++ b/components/safe_browsing_db/v4_protocol_manager_util.cc
|
| @@ -11,6 +11,7 @@
|
| #include "base/strings/stringprintf.h"
|
| #include "crypto/sha2.h"
|
| #include "net/base/escape.h"
|
| +#include "net/base/ip_address.h"
|
| #include "net/http/http_request_headers.h"
|
| #include "url/url_util.h"
|
|
|
| @@ -85,6 +86,10 @@ return LINUX_PLATFORM;
|
| #endif
|
| }
|
|
|
| +const ListIdentifier GetAnyIpMalwareId() {
|
| + return ListIdentifier(ANY_PLATFORM, IP_RANGE, MALWARE_THREAT);
|
| +}
|
| +
|
| const ListIdentifier GetChromeUrlApiId() {
|
| return ListIdentifier(CHROME_PLATFORM, URL, API_ABUSE);
|
| }
|
| @@ -528,4 +533,16 @@ void V4ProtocolManagerUtil::SetClientInfoFromConfig(
|
| client_info->set_client_version(config.version);
|
| }
|
|
|
| +// static
|
| +bool V4ProtocolManagerUtil::GetIPV6AddressFromString(
|
| + const std::string& ip_address,
|
| + net::IPAddress* address) {
|
| + DCHECK(address);
|
| + if (!address->AssignFromIPLiteral(ip_address))
|
| + return false;
|
| + if (address->IsIPv4())
|
| + *address = net::ConvertIPv4ToIPv4MappedIPv6(*address);
|
| + return address->IsIPv6();
|
| +}
|
| +
|
| } // namespace safe_browsing
|
|
|