chromium/components/feed/core/v2/types.h

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

#ifndef COMPONENTS_FEED_CORE_V2_TYPES_H_
#define COMPONENTS_FEED_CORE_V2_TYPES_H_

#include <cstdint>
#include <iosfwd>
#include <string>
#include <vector>

#include "base/containers/flat_set.h"
#include "base/time/time.h"
#include "base/types/id_type.h"
#include "base/values.h"
#include "components/feed/core/proto/v2/store.pb.h"
// #include "components/feed/core/proto/v2/wire/chrome_fulfillment_info.pb.h"
#include "components/feed/core/proto/v2/wire/client_info.pb.h"
#include "components/feed/core/proto/v2/wire/info_card.pb.h"
#include "components/feed/core/proto/v2/wire/reliability_logging_enums.pb.h"
#include "components/feed/core/v2/enums.h"
#include "components/feed/core/v2/ios_shared_experiments_translator.h"
#include "components/feed/core/v2/public/common_enums.h"
#include "components/feed/core/v2/public/types.h"

namespace feed {

// Make sure public types are included here too.
// See components/feed/core/v2/public/types.h.
ChromeInfo;
EphemeralChangeId;
Experiments;
WebFeedSubscriptionRequestStatus;
WebFeedSubscriptionStatus;

// Uniquely identifies a revision of a |feedstore::Content|. If Content changes,
// it is assigned a new revision number.
ContentRevision;

// ID for a stored pending action.
LocalActionId;

std::string ToString(ContentRevision c);
ContentRevision ToContentRevision(const std::string& str);

// Metadata sent with Feed requests.
struct RequestMetadata {};

// Data internal to MetricsReporter which is persisted to Prefs.
struct PersistentMetricsData {};

base::Value::Dict PersistentMetricsDataToDict(
    const PersistentMetricsData& data);
PersistentMetricsData PersistentMetricsDataFromDict(
    const base::Value::Dict& dict);

class LoadLatencyTimes {};

// Tracks a set of `feedstore::Content` content IDs, for tracking whether unread
// content is received from the server. Note that each content ID is a hash of
// the content URL.
class ContentHashSet {};

std::ostream& operator<<(std::ostream& s, const ContentHashSet& id_set);

struct ContentStats {};

struct LaunchResult {};

}  // namespace feed

#endif  // COMPONENTS_FEED_CORE_V2_TYPES_H_