#include "components/safe_browsing/core/browser/hashprefix_realtime/hash_realtime_cache.h"
#include "base/metrics/histogram_functions.h"
#include "base/notreached.h"
#include "base/time/time.h"
#include "components/safe_browsing/core/common/hashprefix_realtime/hash_realtime_utils.h"
#include "components/safe_browsing/core/common/proto/safebrowsingv5.pb.h"
namespace safe_browsing {
namespace {
void LogCacheHitOrMiss(bool is_hit) { … }
void LogInitialCacheDurationOnSet(base::TimeDelta cache_duration) { … }
void LogRemainingCacheDurationOnHit(base::Time expiration_time) { … }
}
HashRealTimeCache::HashRealTimeCache() = default;
HashRealTimeCache::~HashRealTimeCache() = default;
HashRealTimeCache::FullHashesAndDetails::FullHashesAndDetails() = default;
HashRealTimeCache::FullHashesAndDetails::~FullHashesAndDetails() = default;
std::unordered_map<std::string, std::vector<V5::FullHash>>
HashRealTimeCache::SearchCache(
const std::set<std::string>& hash_prefixes) const { … }
void HashRealTimeCache::CacheSearchHashesResponse(
const std::vector<std::string>& requested_hash_prefixes,
const std::vector<V5::FullHash>& response_full_hashes,
const V5::Duration& cache_duration) { … }
void HashRealTimeCache::ClearExpiredResults() { … }
}