#include "net/dns/mdns_cache.h"
#include <algorithm>
#include <tuple>
#include <utility>
#include "base/containers/contains.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "net/dns/public/dns_protocol.h"
#include "net/dns/record_parsed.h"
#include "net/dns/record_rdata.h"
namespace net {
namespace {
constexpr size_t kDefaultEntryLimit = …;
}
static const unsigned kZeroTTLSeconds = …;
MDnsCache::Key::Key(unsigned type,
const std::string& name,
const std::string& optional)
: … { … }
MDnsCache::Key::Key(const MDnsCache::Key& other) = default;
MDnsCache::Key& MDnsCache::Key::operator=(const MDnsCache::Key& other) =
default;
MDnsCache::Key::~Key() = default;
bool MDnsCache::Key::operator<(const MDnsCache::Key& other) const { … }
bool MDnsCache::Key::operator==(const MDnsCache::Key& key) const { … }
MDnsCache::Key MDnsCache::Key::CreateFor(const RecordParsed* record) { … }
MDnsCache::MDnsCache() : … { … }
MDnsCache::~MDnsCache() = default;
const RecordParsed* MDnsCache::LookupKey(const Key& key) { … }
MDnsCache::UpdateType MDnsCache::UpdateDnsRecord(
std::unique_ptr<const RecordParsed> record) { … }
void MDnsCache::CleanupRecords(
base::Time now,
const RecordRemovedCallback& record_removed_callback) { … }
void MDnsCache::FindDnsRecords(unsigned type,
const std::string& name,
std::vector<const RecordParsed*>* results,
base::Time now) const { … }
std::unique_ptr<const RecordParsed> MDnsCache::RemoveRecord(
const RecordParsed* record) { … }
bool MDnsCache::IsCacheOverfilled() const { … }
std::string MDnsCache::GetOptionalFieldForRecord(const RecordParsed* record) { … }
base::Time MDnsCache::GetEffectiveExpiration(const RecordParsed* record) { … }
}