// 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_HISTORY_CLUSTERS_CORE_HISTORY_CLUSTERS_SERVICE_TASK_UPDATE_CLUSTERS_H_ #define COMPONENTS_HISTORY_CLUSTERS_CORE_HISTORY_CLUSTERS_SERVICE_TASK_UPDATE_CLUSTERS_H_ #include <vector> #include "base/memory/weak_ptr.h" #include "base/task/cancelable_task_tracker.h" #include "base/time/time.h" #include "components/history/core/browser/history_types.h" #include "components/history_clusters/core/clustering_backend.h" #include "components/history_clusters/core/history_clusters_service_task.h" #include "components/history_clusters/core/history_clusters_types.h" namespace history { class HistoryService; } namespace history_clusters { class HistoryClustersService; // `HistoryClustersServiceTaskUpdateClusters` gets clustered and unclustered // visits straddling the threshold and clusters them together. It continues // doing so, moving the threshold forward 1 day each time, until reaching today. // When re-clustering clustered visits, it takes all visits in their clusters // and replaces those clusters. This allows existing clusters to grow without // having to cluster an impractical number of visits simultaneously and without // creating near-duplicate clusters. The similar // `HistoryClustersServiceTaskGetMostRecentClusters` will consume the clusters // this creates. In contrast to this, // `HistoryClustersServiceTaskGetMostRecentClusters` iterates recent visits 1st // and does not persist them. class HistoryClustersServiceTaskUpdateClusters : public HistoryClustersServiceTask { … }; } // namespace history_clusters #endif // COMPONENTS_HISTORY_CLUSTERS_CORE_HISTORY_CLUSTERS_SERVICE_TASK_UPDATE_CLUSTERS_H_