chromium/components/affiliations/core/browser/affiliation_backend.h

// Copyright 2015 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_AFFILIATIONS_CORE_BROWSER_AFFILIATION_BACKEND_H_
#define COMPONENTS_AFFILIATIONS_CORE_BROWSER_AFFILIATION_BACKEND_H_

#include <stddef.h>

#include <map>
#include <memory>
#include <unordered_map>

#include "base/gtest_prod_util.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/sequence_checker.h"
#include "base/time/time.h"
#include "components/affiliations/core/browser/affiliation_fetch_throttler_delegate.h"
#include "components/affiliations/core/browser/affiliation_fetcher_delegate.h"
#include "components/affiliations/core/browser/affiliation_service.h"
#include "components/affiliations/core/browser/affiliation_utils.h"
#include "components/affiliations/core/browser/facet_manager_host.h"

namespace base {
class Clock;
class FilePath;
class SequencedTaskRunner;
class TaskRunner;
class TickClock;
class Time;
}  // namespace base

namespace network {
class NetworkConnectionTracker;
class PendingSharedURLLoaderFactory;
class SharedURLLoaderFactory;
}  // namespace network

namespace affiliations {

class AffiliationDatabase;
class AffiliationFetcherInterface;
class AffiliationFetcherFactory;
class AffiliationFetchThrottler;
class FacetManager;

// The AffiliationBackend is the part of the AffiliationService that
// lives on a background thread suitable for performing blocking I/O. As most
// tasks require I/O, the backend ends up doing most of the work for the
// AffiliationService; the latter being just a thin layer that delegates
// most tasks to the backend.
//
// This class is not thread-safe, but it is fine to construct it on one thread
// and then transfer it to the background thread for the rest of its life.
// Initialize() must be called already on the final (background) thread.
class AffiliationBackend : public FacetManagerHost,
                           public AffiliationFetcherDelegate,
                           public AffiliationFetchThrottlerDelegate {};

}  // namespace affiliations

#endif  // COMPONENTS_AFFILIATIONS_CORE_BROWSER_AFFILIATION_BACKEND_H_