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

Unified Diff: net/dns/record_rdata.h

Issue 2118383006: Fix "conversion of size_t to unsigned int" warning (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addresses final comments from Ryan Created 4 years, 5 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 | « no previous file | net/dns/record_rdata_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/dns/record_rdata.h
diff --git a/net/dns/record_rdata.h b/net/dns/record_rdata.h
index d2ca587c5e7811ebb72ab8fce6db6f1c854acc90..0aa29d5786647eab8bc3025fd6b81ad59b12108c 100644
--- a/net/dns/record_rdata.h
+++ b/net/dns/record_rdata.h
@@ -12,6 +12,7 @@
#include <vector>
#include "base/compiler_specific.h"
+#include "base/logging.h"
#include "base/macros.h"
#include "base/strings/string_piece.h"
#include "net/base/ip_address.h"
@@ -198,7 +199,11 @@ class NET_EXPORT_PRIVATE NsecRecordRdata : public RecordRdata {
uint16_t Type() const override;
// Length of the bitmap in bits.
- unsigned bitmap_length() const { return bitmap_.size() * 8; }
+ // This will be between 8 and 256, per RFC 3845, Section 2.1.2.
+ uint16_t bitmap_length() const {
+ DCHECK_LE(bitmap_.size(), 32u);
+ return static_cast<uint16_t>(bitmap_.size() * 8);
+ }
// Returns bit i-th bit in the bitmap, where bits withing a byte are organized
// most to least significant. If it is set, a record with rrtype i exists for
« no previous file with comments | « no previous file | net/dns/record_rdata_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698