Index: net/dns/mdns_cache.cc |
diff --git a/net/dns/mdns_cache.cc b/net/dns/mdns_cache.cc |
index 010a34f45d479619fc24ff4db189cfa6c5c0d88f..f220c1b4a148f3cabb3e4ade0487d78a01ce7184 100644 |
--- a/net/dns/mdns_cache.cc |
+++ b/net/dns/mdns_cache.cc |
@@ -22,19 +22,17 @@ namespace net { |
// Section 10.1. |
static const unsigned kZeroTTLSeconds = 1; |
-MDnsCache::Key::Key(unsigned type, const std::string& name, |
+MDnsCache::Key::Key(unsigned type, |
+ const std::string& name, |
const std::string& optional) |
: type_(type), name_(name), optional_(optional) { |
} |
-MDnsCache::Key::Key( |
- const MDnsCache::Key& other) |
+MDnsCache::Key::Key(const MDnsCache::Key& other) |
: type_(other.type_), name_(other.name_), optional_(other.optional_) { |
} |
- |
-MDnsCache::Key& MDnsCache::Key::operator=( |
- const MDnsCache::Key& other) { |
+MDnsCache::Key& MDnsCache::Key::operator=(const MDnsCache::Key& other) { |
type_ = other.type_; |
name_ = other.name_; |
optional_ = other.optional_; |
@@ -62,12 +60,9 @@ bool MDnsCache::Key::operator==(const MDnsCache::Key& key) const { |
// static |
MDnsCache::Key MDnsCache::Key::CreateFor(const RecordParsed* record) { |
- return Key(record->type(), |
- record->name(), |
- GetOptionalFieldForRecord(record)); |
+ return Key(record->type(), record->name(), GetOptionalFieldForRecord(record)); |
} |
- |
MDnsCache::MDnsCache() { |
} |
@@ -127,17 +122,17 @@ void MDnsCache::CleanupRecords( |
// We are guaranteed that |next_expiration_| will be at or before the next |
// expiration. This allows clients to eagrely call CleanupRecords with |
// impunity. |
- if (now < next_expiration_) return; |
+ if (now < next_expiration_) |
+ return; |
- for (RecordMap::iterator i = mdns_cache_.begin(); |
- i != mdns_cache_.end(); ) { |
+ for (RecordMap::iterator i = mdns_cache_.begin(); i != mdns_cache_.end();) { |
base::Time expiration = GetEffectiveExpiration(i->second); |
if (now >= expiration) { |
record_removed_callback.Run(i->second); |
delete i->second; |
mdns_cache_.erase(i++); |
} else { |
- if (next_expiration == base::Time() || expiration < next_expiration) { |
+ if (next_expiration == base::Time() || expiration < next_expiration) { |
next_expiration = expiration; |
} |
++i; |
@@ -156,15 +151,15 @@ void MDnsCache::FindDnsRecords(unsigned type, |
RecordMap::const_iterator i = mdns_cache_.lower_bound(Key(type, name, "")); |
for (; i != mdns_cache_.end(); ++i) { |
- if (i->first.name() != name || |
- (type != 0 && i->first.type() != type)) { |
+ if (i->first.name() != name || (type != 0 && i->first.type() != type)) { |
break; |
} |
const RecordParsed* record = i->second; |
// Records are deleted only upon request. |
- if (now >= GetEffectiveExpiration(record)) continue; |
+ if (now >= GetEffectiveExpiration(record)) |
+ continue; |
results->push_back(record); |
} |
@@ -184,8 +179,7 @@ scoped_ptr<const RecordParsed> MDnsCache::RemoveRecord( |
} |
// static |
-std::string MDnsCache::GetOptionalFieldForRecord( |
- const RecordParsed* record) { |
+std::string MDnsCache::GetOptionalFieldForRecord(const RecordParsed* record) { |
switch (record->type()) { |
case PtrRecordRdata::kType: { |
const PtrRecordRdata* rdata = record->rdata<PtrRecordRdata>(); |