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

Unified Diff: net/cert/internal/name_constraints.cc

Issue 2881673002: Avoid heap allocations in IPAddress (Closed)
Patch Set: New constructor Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/base/ip_address_unittest.cc ('k') | net/dns/mdns_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/internal/name_constraints.cc
diff --git a/net/cert/internal/name_constraints.cc b/net/cert/internal/name_constraints.cc
index 0ed685101e9a15d6463ed693188273aed304c5fa..d9329803c0aec55f6a38a607ec8c9fe7cc156c3a 100644
--- a/net/cert/internal/name_constraints.cc
+++ b/net/cert/internal/name_constraints.cc
@@ -104,7 +104,7 @@ bool DNSNameMatches(base::StringPiece name,
// Return true if the bitmask |mask| contains only zeros after the first
// |prefix_length| bits.
-bool IsSuffixZero(const std::vector<uint8_t>& mask, unsigned prefix_length) {
+bool IsSuffixZero(const IPAddressBytes& mask, unsigned prefix_length) {
size_t zero_bits = mask.size() * CHAR_BIT - prefix_length;
size_t zero_bytes = zero_bits / CHAR_BIT;
std::vector<uint8_t> zeros(zero_bytes, 0);
« no previous file with comments | « net/base/ip_address_unittest.cc ('k') | net/dns/mdns_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698