#include "components/domain_reliability/context.h"
#include <algorithm>
#include <limits>
#include <utility>
#include "base/functional/bind.h"
#include "base/json/json_writer.h"
#include "base/logging.h"
#include "base/metrics/histogram_macros.h"
#include "base/metrics/sparse_histogram.h"
#include "base/not_fatal_until.h"
#include "base/rand_util.h"
#include "base/values.h"
#include "components/domain_reliability/dispatcher.h"
#include "components/domain_reliability/uploader.h"
#include "components/domain_reliability/util.h"
#include "net/base/net_errors.h"
namespace domain_reliability {
const int DomainReliabilityContext::kMaxUploadDepthToSchedule = …;
const size_t DomainReliabilityContext::kMaxQueuedBeacons = …;
DomainReliabilityContext::DomainReliabilityContext(
const MockableTime* time,
const DomainReliabilityScheduler::Params& scheduler_params,
const std::string& upload_reporter_string,
const base::TimeTicks* last_network_change_time,
const UploadAllowedCallback& upload_allowed_callback,
DomainReliabilityDispatcher* dispatcher,
DomainReliabilityUploader* uploader,
std::unique_ptr<const DomainReliabilityConfig> config)
: … { … }
DomainReliabilityContext::~DomainReliabilityContext() { … }
void DomainReliabilityContext::OnBeacon(
std::unique_ptr<DomainReliabilityBeacon> beacon) { … }
void DomainReliabilityContext::ClearBeacons() { … }
void DomainReliabilityContext::GetQueuedBeaconsForTesting(
std::vector<const DomainReliabilityBeacon*>* beacons_out) const { … }
void DomainReliabilityContext::ScheduleUpload(
base::TimeDelta min_delay,
base::TimeDelta max_delay) { … }
void DomainReliabilityContext::CallUploadAllowedCallback() { … }
void DomainReliabilityContext::OnUploadAllowedCallbackComplete(bool allowed) { … }
void DomainReliabilityContext::StartUpload() { … }
void DomainReliabilityContext::OnUploadComplete(
const DomainReliabilityUploader::UploadResult& result) { … }
base::Value DomainReliabilityContext::CreateReport(base::TimeTicks upload_time,
const GURL& collector_url,
int* max_upload_depth_out) { … }
void DomainReliabilityContext::CommitUpload() { … }
void DomainReliabilityContext::RollbackUpload() { … }
void DomainReliabilityContext::RemoveOldestBeacon() { … }
void DomainReliabilityContext::RemoveExpiredBeacons() { … }
int DomainReliabilityContext::GetMinBeaconUploadDepth() const { … }
}