// 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_BROWSING_TOPICS_BROWSING_TOPICS_STATE_H_ #define COMPONENTS_BROWSING_TOPICS_BROWSING_TOPICS_STATE_H_ #include "base/containers/queue.h" #include "base/files/important_file_writer.h" #include "base/gtest_prod_util.h" #include "base/task/sequenced_task_runner.h" #include "base/time/time.h" #include "components/browsing_topics/common/common_types.h" #include "components/browsing_topics/epoch_topics.h" namespace browsing_topics { // Contains the data needed to calculate the browsing topics when a context // requests it via document.browsingTopics(). The data is backed by a JSON file: // when `BrowsingTopicsState` is initialized, the state members will be read // from the file on a backend thread, and all overwriting methods will schedule // an update to the file. The `BrowsingTopicsState`'s owner should listen on the // `loaded_callback` notification. Before the loading finishes, it's disallowed // to access this `BrowsingTopicsState`. class BrowsingTopicsState : public base::ImportantFileWriter::BackgroundDataSerializer { … }; } // namespace browsing_topics #endif // COMPONENTS_BROWSING_TOPICS_BROWSING_TOPICS_STATE_H_