#include "net/reporting/reporting_context.h"
#include <utility>
#include "base/functional/bind.h"
#include "base/observer_list.h"
#include "base/rand_util.h"
#include "base/time/clock.h"
#include "base/time/default_clock.h"
#include "base/time/default_tick_clock.h"
#include "base/time/tick_clock.h"
#include "base/time/time.h"
#include "net/base/backoff_entry.h"
#include "net/base/rand_callback.h"
#include "net/reporting/reporting_cache_observer.h"
#include "net/reporting/reporting_delegate.h"
#include "net/reporting/reporting_delivery_agent.h"
#include "net/reporting/reporting_garbage_collector.h"
#include "net/reporting/reporting_network_change_observer.h"
#include "net/reporting/reporting_policy.h"
#include "net/reporting/reporting_uploader.h"
namespace net {
class URLRequestContext;
namespace {
class ReportingContextImpl : public ReportingContext { … };
}
std::unique_ptr<ReportingContext> ReportingContext::Create(
const ReportingPolicy& policy,
URLRequestContext* request_context,
ReportingCache::PersistentReportingStore* store,
const base::flat_map<std::string, GURL>& enterprise_reporting_endpoints) { … }
ReportingContext::~ReportingContext() = default;
void ReportingContext::AddCacheObserver(ReportingCacheObserver* observer) { … }
void ReportingContext::RemoveCacheObserver(ReportingCacheObserver* observer) { … }
void ReportingContext::NotifyCachedReportsUpdated() { … }
void ReportingContext::NotifyReportAdded(const ReportingReport* report) { … }
void ReportingContext::NotifyReportUpdated(const ReportingReport* report) { … }
void ReportingContext::NotifyCachedClientsUpdated() { … }
void ReportingContext::NotifyEndpointsUpdatedForOrigin(
const std::vector<ReportingEndpoint>& endpoints) { … }
bool ReportingContext::IsReportDataPersisted() const { … }
bool ReportingContext::IsClientDataPersisted() const { … }
void ReportingContext::OnShutdown() { … }
ReportingContext::ReportingContext(
const ReportingPolicy& policy,
base::Clock* clock,
const base::TickClock* tick_clock,
const RandIntCallback& rand_callback,
std::unique_ptr<ReportingUploader> uploader,
std::unique_ptr<ReportingDelegate> delegate,
ReportingCache::PersistentReportingStore* store,
const base::flat_map<std::string, GURL>& enterprise_reporting_endpoints)
: … { … }
}