#include "components/feed/core/v2/view_demotion.h"
#include <algorithm>
#include <map>
#include <ostream>
#include <tuple>
#include <vector>
#include "base/check_op.h"
#include "base/containers/flat_set.h"
#include "base/feature_list.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/metrics/histogram_functions.h"
#include "base/ranges/algorithm.h"
#include "base/time/time.h"
#include "components/feed/core/proto/v2/store.pb.h"
#include "components/feed/core/v2/config.h"
#include "components/feed/core/v2/feed_store.h"
#include "components/feed/core/v2/feed_stream.h"
#include "components/feed/core/v2/feedstore_util.h"
#include "components/feed/feed_feature_list.h"
namespace feed {
namespace {
base::TimeDelta kMaxViewAge = …;
bool IsEnabled(FeedStream& feed_stream) { … }
}
namespace internal {
DocViewDigest CreateDigest(std::vector<feedstore::DocView> all_views) { … }
}
bool DocViewCount::operator==(const DocViewCount& rhs) const { … }
void ReadDocViewDigestIfEnabled(
FeedStream& feed_stream,
base::OnceCallback<void(DocViewDigest)> callback) { … }
void RemoveOldDocViews(const DocViewDigest& doc_view_digest,
FeedStore& feed_store) { … }
void WriteDocViewIfEnabled(FeedStream& feed_stream, uint64_t docid) { … }
DocViewDigest::DocViewDigest() = default;
DocViewDigest::~DocViewDigest() = default;
DocViewDigest::DocViewDigest(const DocViewDigest&) = default;
DocViewDigest::DocViewDigest(DocViewDigest&&) = default;
DocViewDigest& DocViewDigest::operator=(const DocViewDigest&) = default;
DocViewDigest& DocViewDigest::operator=(DocViewDigest&&) = default;
std::ostream& operator<<(std::ostream& os, const DocViewCount& doc_view_count) { … }
}