| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #include "components/safe_browsing_db/v4_protocol_manager_util.h" | 5 #include "components/safe_browsing_db/v4_protocol_manager_util.h" |
| 6 | 6 |
| 7 #include "base/base64.h" | 7 #include "base/base64.h" |
| 8 #include "base/metrics/histogram_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
| 9 #include "base/rand_util.h" | 9 #include "base/rand_util.h" |
| 10 #include "base/sha1.h" | 10 #include "base/sha1.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 // the platform_type empty, the server won't recognize the request and | 84 // the platform_type empty, the server won't recognize the request and |
| 85 // return an error response which will pollute our UMA metrics. | 85 // return an error response which will pollute our UMA metrics. |
| 86 return LINUX_PLATFORM; | 86 return LINUX_PLATFORM; |
| 87 #endif | 87 #endif |
| 88 } | 88 } |
| 89 | 89 |
| 90 const ListIdentifier GetCertCsdDownloadWhitelistId() { | 90 const ListIdentifier GetCertCsdDownloadWhitelistId() { |
| 91 return ListIdentifier(GetCurrentPlatformType(), CERT, CSD_DOWNLOAD_WHITELIST); | 91 return ListIdentifier(GetCurrentPlatformType(), CERT, CSD_DOWNLOAD_WHITELIST); |
| 92 } | 92 } |
| 93 | 93 |
| 94 const ListIdentifier GetChromeExtensionMalwareId() { | 94 const ListIdentifier GetChromeExtMalwareId() { |
| 95 return ListIdentifier(CHROME_PLATFORM, CHROME_EXTENSION, MALWARE_THREAT); | 95 return ListIdentifier(CHROME_PLATFORM, CHROME_EXTENSION, MALWARE_THREAT); |
| 96 } | 96 } |
| 97 | 97 |
| 98 const ListIdentifier GetChromeUrlApiId() { | 98 const ListIdentifier GetChromeUrlApiId() { |
| 99 return ListIdentifier(CHROME_PLATFORM, URL, API_ABUSE); | 99 return ListIdentifier(CHROME_PLATFORM, URL, API_ABUSE); |
| 100 } | 100 } |
| 101 | 101 |
| 102 const ListIdentifier GetChromeFilenameClientIncidentId() { | 102 const ListIdentifier GetChromeFilenameClientIncidentId() { |
| 103 return ListIdentifier(CHROME_PLATFORM, FILENAME, CLIENT_INCIDENT); | 103 return ListIdentifier(CHROME_PLATFORM, FILENAME, CLIENT_INCIDENT); |
| 104 } | 104 } |
| (...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 577 | 577 |
| 578 const std::string hash = base::SHA1HashString(packed_ip); | 578 const std::string hash = base::SHA1HashString(packed_ip); |
| 579 DCHECK_EQ(20u, hash.size()); | 579 DCHECK_EQ(20u, hash.size()); |
| 580 hashed_encoded_ip->resize(hash.size() + 1); | 580 hashed_encoded_ip->resize(hash.size() + 1); |
| 581 hashed_encoded_ip->replace(0, hash.size(), hash); | 581 hashed_encoded_ip->replace(0, hash.size(), hash); |
| 582 (*hashed_encoded_ip)[hash.size()] = static_cast<unsigned char>(128); | 582 (*hashed_encoded_ip)[hash.size()] = static_cast<unsigned char>(128); |
| 583 return true; | 583 return true; |
| 584 } | 584 } |
| 585 | 585 |
| 586 } // namespace safe_browsing | 586 } // namespace safe_browsing |
| OLD | NEW |