| Index: net/dns/record_rdata.cc
|
| diff --git a/net/dns/record_rdata.cc b/net/dns/record_rdata.cc
|
| index 0c605593ab7d337b1edf18ebda380d1a0d6e0ead..7ad6e6ba56a002152a7e4b46f97f7d9a1d7945f4 100644
|
| --- a/net/dns/record_rdata.cc
|
| +++ b/net/dns/record_rdata.cc
|
| @@ -19,13 +19,15 @@ RecordRdata::RecordRdata() {
|
| SrvRecordRdata::SrvRecordRdata() : priority_(0), weight_(0), port_(0) {
|
| }
|
|
|
| -SrvRecordRdata::~SrvRecordRdata() {}
|
| +SrvRecordRdata::~SrvRecordRdata() {
|
| +}
|
|
|
| // static
|
| scoped_ptr<SrvRecordRdata> SrvRecordRdata::Create(
|
| const base::StringPiece& data,
|
| const DnsRecordParser& parser) {
|
| - if (data.size() < kSrvRecordMinimumSize) return scoped_ptr<SrvRecordRdata>();
|
| + if (data.size() < kSrvRecordMinimumSize)
|
| + return scoped_ptr<SrvRecordRdata>();
|
|
|
| scoped_ptr<SrvRecordRdata> rdata(new SrvRecordRdata);
|
|
|
| @@ -47,12 +49,11 @@ uint16 SrvRecordRdata::Type() const {
|
| }
|
|
|
| bool SrvRecordRdata::IsEqual(const RecordRdata* other) const {
|
| - if (other->Type() != Type()) return false;
|
| + if (other->Type() != Type())
|
| + return false;
|
| const SrvRecordRdata* srv_other = static_cast<const SrvRecordRdata*>(other);
|
| - return weight_ == srv_other->weight_ &&
|
| - port_ == srv_other->port_ &&
|
| - priority_ == srv_other->priority_ &&
|
| - target_ == srv_other->target_;
|
| + return weight_ == srv_other->weight_ && port_ == srv_other->port_ &&
|
| + priority_ == srv_other->priority_ && target_ == srv_other->target_;
|
| }
|
|
|
| ARecordRdata::ARecordRdata() {
|
| @@ -62,9 +63,8 @@ ARecordRdata::~ARecordRdata() {
|
| }
|
|
|
| // static
|
| -scoped_ptr<ARecordRdata> ARecordRdata::Create(
|
| - const base::StringPiece& data,
|
| - const DnsRecordParser& parser) {
|
| +scoped_ptr<ARecordRdata> ARecordRdata::Create(const base::StringPiece& data,
|
| + const DnsRecordParser& parser) {
|
| if (data.size() != kIPv4AddressSize)
|
| return scoped_ptr<ARecordRdata>();
|
|
|
| @@ -83,7 +83,8 @@ uint16 ARecordRdata::Type() const {
|
| }
|
|
|
| bool ARecordRdata::IsEqual(const RecordRdata* other) const {
|
| - if (other->Type() != Type()) return false;
|
| + if (other->Type() != Type())
|
| + return false;
|
| const ARecordRdata* a_other = static_cast<const ARecordRdata*>(other);
|
| return address_ == a_other->address_;
|
| }
|
| @@ -116,7 +117,8 @@ uint16 AAAARecordRdata::Type() const {
|
| }
|
|
|
| bool AAAARecordRdata::IsEqual(const RecordRdata* other) const {
|
| - if (other->Type() != Type()) return false;
|
| + if (other->Type() != Type())
|
| + return false;
|
| const AAAARecordRdata* a_other = static_cast<const AAAARecordRdata*>(other);
|
| return address_ == a_other->address_;
|
| }
|
| @@ -144,7 +146,8 @@ uint16 CnameRecordRdata::Type() const {
|
| }
|
|
|
| bool CnameRecordRdata::IsEqual(const RecordRdata* other) const {
|
| - if (other->Type() != Type()) return false;
|
| + if (other->Type() != Type())
|
| + return false;
|
| const CnameRecordRdata* cname_other =
|
| static_cast<const CnameRecordRdata*>(other);
|
| return cname_ == cname_other->cname_;
|
| @@ -173,7 +176,8 @@ uint16 PtrRecordRdata::Type() const {
|
| }
|
|
|
| bool PtrRecordRdata::IsEqual(const RecordRdata* other) const {
|
| - if (other->Type() != Type()) return false;
|
| + if (other->Type() != Type())
|
| + return false;
|
| const PtrRecordRdata* ptr_other = static_cast<const PtrRecordRdata*>(other);
|
| return ptrdomain_ == ptr_other->ptrdomain_;
|
| }
|
| @@ -190,7 +194,7 @@ scoped_ptr<TxtRecordRdata> TxtRecordRdata::Create(
|
| const DnsRecordParser& parser) {
|
| scoped_ptr<TxtRecordRdata> rdata(new TxtRecordRdata);
|
|
|
| - for (size_t i = 0; i < data.size(); ) {
|
| + for (size_t i = 0; i < data.size();) {
|
| uint8 length = data[i];
|
|
|
| if (i + length >= data.size())
|
| @@ -210,7 +214,8 @@ uint16 TxtRecordRdata::Type() const {
|
| }
|
|
|
| bool TxtRecordRdata::IsEqual(const RecordRdata* other) const {
|
| - if (other->Type() != Type()) return false;
|
| + if (other->Type() != Type())
|
| + return false;
|
| const TxtRecordRdata* txt_other = static_cast<const TxtRecordRdata*>(other);
|
| return texts_ == txt_other->texts_;
|
| }
|
| @@ -238,11 +243,11 @@ scoped_ptr<NsecRecordRdata> NsecRecordRdata::Create(
|
|
|
| struct BitmapHeader {
|
| uint8 block_number; // The block number should be zero.
|
| - uint8 length; // Bitmap length in bytes. Between 1 and 32.
|
| + uint8 length; // Bitmap length in bytes. Between 1 and 32.
|
| };
|
|
|
| - const BitmapHeader* header = reinterpret_cast<const BitmapHeader*>(
|
| - data.data() + next_domain_length);
|
| + const BitmapHeader* header =
|
| + reinterpret_cast<const BitmapHeader*>(data.data() + next_domain_length);
|
|
|
| // The block number must be zero in mDns-specific NSEC records. The bitmap
|
| // length must be between 1 and 32.
|
| @@ -256,9 +261,8 @@ scoped_ptr<NsecRecordRdata> NsecRecordRdata::Create(
|
| if (bitmap_data.length() != header->length)
|
| return scoped_ptr<NsecRecordRdata>();
|
|
|
| - rdata->bitmap_.insert(rdata->bitmap_.begin(),
|
| - bitmap_data.begin(),
|
| - bitmap_data.end());
|
| + rdata->bitmap_.insert(
|
| + rdata->bitmap_.begin(), bitmap_data.begin(), bitmap_data.end());
|
|
|
| return rdata.Pass();
|
| }
|
| @@ -276,7 +280,7 @@ bool NsecRecordRdata::IsEqual(const RecordRdata* other) const {
|
| }
|
|
|
| bool NsecRecordRdata::GetBit(unsigned i) const {
|
| - unsigned byte_num = i/8;
|
| + unsigned byte_num = i / 8;
|
| if (bitmap_.size() < byte_num + 1)
|
| return false;
|
|
|
|
|