Chromium Code Reviews| Index: chrome/browser/safe_browsing/safe_browsing_database.cc |
| diff --git a/chrome/browser/safe_browsing/safe_browsing_database.cc b/chrome/browser/safe_browsing/safe_browsing_database.cc |
| index 586ee45841db2d6e9d1b19a5c9b00709ede92b11..bd87b89bb132dda31cd83b88002dce981e70fd47 100644 |
| --- a/chrome/browser/safe_browsing/safe_browsing_database.cc |
| +++ b/chrome/browser/safe_browsing/safe_browsing_database.cc |
| @@ -27,6 +27,7 @@ |
| #include "build/build_config.h" |
| #include "chrome/browser/safe_browsing/safe_browsing_store_file.h" |
| #include "components/safe_browsing_db/prefix_set.h" |
| +#include "components/safe_browsing_db/v4_protocol_manager_util.h" |
| #include "content/public/browser/browser_thread.h" |
| #include "crypto/sha2.h" |
| #include "net/base/ip_address.h" |
| @@ -958,12 +959,9 @@ bool SafeBrowsingDatabaseNew::ContainsExtensionPrefixes( |
| bool SafeBrowsingDatabaseNew::ContainsMalwareIP(const std::string& ip_address) { |
| net::IPAddress address; |
| - if (!address.AssignFromIPLiteral(ip_address)) |
| + if (!V4ProtocolManagerUtil::GetIPV6AddressFromString(ip_address, &address)) { |
|
Nathan Parker
2016/11/15 00:54:46
Is there value in updating this (legacy) code?
vakh (use Gerrit instead)
2016/11/15 01:03:41
Smaller binary size until we rip out PVer3 complet
Scott Hess - ex-Googler
2016/11/15 01:21:10
Do you have binary-size metrics to back that up?
vakh (use Gerrit instead)
2016/11/15 01:27:51
No, but if we leave the same code in two places, i
Scott Hess - ex-Googler
2016/11/15 01:34:24
For small functions, it depends on if the various
|
| return false; |
| - if (address.IsIPv4()) |
| - address = net::ConvertIPv4ToIPv4MappedIPv6(address); |
| - if (!address.IsIPv6()) |
| - return false; // better safe than sorry. |
| + } |
| std::unique_ptr<ReadTransaction> txn = state_manager_.BeginReadTransaction(); |
| const IPBlacklist* ip_blacklist = txn->ip_blacklist(); |