// Copyright 2022 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_XSURFACE_DATASTORE_H_ #define COMPONENTS_FEED_CORE_V2_XSURFACE_DATASTORE_H_ #include <map> #include <string> #include <vector> #include "base/observer_list.h" // This file defines some types related to the XSurface datastore. // The XSurface datastore is a generic key-value store, which can affect the // display of UI elements. In some cases, we populate data store with // information source by the Feed component. namespace feed { // Write-access to something that stores data store elements. class XsurfaceDatastoreDataWriter { … }; // Read-access to something that stores data store elements. class XsurfaceDatastoreDataReader { … }; // A set of data exported to the XSurface datastore. class XsurfaceDatastoreSlice : public XsurfaceDatastoreDataReader, public XsurfaceDatastoreDataWriter { … }; // Combines multiple `XsurfaceDatastoreDataReader`s, to provide access to all // stored data. This implementation assumes that each contained // `XsurfaceDatastoreDataReader` provides a disjoint set of keys, so that there // can be no key collision between `sources`. class XsurfaceDatastoreAggregate : public XsurfaceDatastoreDataReader, public XsurfaceDatastoreDataReader::Observer { … }; } // namespace feed #endif // COMPONENTS_FEED_CORE_V2_XSURFACE_DATASTORE_H_