chromium/components/feed/core/v2/feedstore_util.cc

// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/feed/core/v2/feedstore_util.h"

#include <string_view>

#include "base/base64url.h"
#include "base/hash/hash.h"
#include "base/strings/strcat.h"
#include "components/feed/core/proto/v2/store.pb.h"
#include "components/feed/core/proto/v2/wire/consistency_token.pb.h"
#include "components/feed/core/v2/config.h"
#include "components/feed/core/v2/feed_store.h"
#include "components/feed/core/v2/public/stream_type.h"

namespace feedstore {
LocalActionId;
StreamType;

// This returns a string version of StreamType which can be used in datastore
// keys.
std::string StreamKey(const StreamType& stream_type) {}

std::string_view StreamPrefix(feed::StreamKind stream_kind) {}

StreamType DecodeSingleWebFeedKeySuffix(
    std::string_view suffix,
    feed::SingleWebFeedEntryPoint entry_point,
    std::string_view prefix) {}

StreamType StreamTypeFromKey(std::string_view id) {}

int64_t ToTimestampMillis(base::Time t) {}

base::Time FromTimestampMillis(int64_t millis) {}

int64_t ToTimestampNanos(base::Time t) {}

base::Time FromTimestampMicros(int64_t micros) {}

void SetLastAddedTime(base::Time t, feedstore::StreamData& data) {}

base::Time GetLastAddedTime(const feedstore::StreamData& data) {}

base::Time GetSessionIdExpiryTime(const Metadata& metadata) {}

void SetSessionId(Metadata& metadata,
                  std::string token,
                  base::Time expiry_time) {}

void SetContentLifetime(
    feedstore::Metadata& metadata,
    const StreamType& stream_type,
    feedstore::Metadata::StreamMetadata::ContentLifetime content_lifetime) {}

void MaybeUpdateSessionId(Metadata& metadata,
                          std::optional<std::string> token) {}

std::optional<Metadata> MaybeUpdateConsistencyToken(
    const feedstore::Metadata& metadata,
    const feedwire::ConsistencyToken& token) {}

LocalActionId GetNextActionId(Metadata& metadata) {}

const Metadata::StreamMetadata* FindMetadataForStream(
    const Metadata& metadata,
    const StreamType& stream_type) {}

Metadata::StreamMetadata& MetadataForStream(Metadata& metadata,
                                            const StreamType& stream_type) {}

void SetStreamViewContentHashes(Metadata& metadata,
                                const StreamType& stream_type,
                                const feed::ContentHashSet& content_hashes) {}

bool IsKnownStale(const Metadata& metadata, const StreamType& stream_type) {}

base::Time GetLastFetchTime(const Metadata& metadata,
                            const feed::StreamType& stream_type) {}

void SetLastFetchTime(Metadata& metadata,
                      const StreamType& stream_type,
                      const base::Time& fetch_time) {}

feedstore::Metadata MakeMetadata(const std::string& gaia) {}

feedstore::DocView CreateDocView(uint64_t docid, base::Time timestamp) {}

std::optional<Metadata> SetStreamViewContentHashes(
    const Metadata& metadata,
    const StreamType& stream_type,
    const feed::ContentHashSet& content_hashes) {}

feed::ContentHashSet GetContentIds(const StreamData& stream_data) {}
feed::ContentHashSet GetViewContentIds(const Metadata& metadata,
                                       const StreamType& stream_type) {}

void SetLastServerResponseTime(Metadata& metadata,
                               const feed::StreamType& stream_type,
                               const base::Time& server_time) {}

int32_t ContentHashFromPrefetchMetadata(
    const feedwire::PrefetchMetadata& prefetch_metadata) {}

base::flat_set<uint32_t> GetViewedContentHashes(const Metadata& metadata,
                                                const StreamType& stream_type) {}

}  // namespace feedstore