#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "components/domain_reliability/util.h"
#include <stddef.h>
#include "base/functional/callback.h"
#include "base/memory/weak_ptr.h"
#include "base/notreached.h"
#include "base/time/default_tick_clock.h"
#include "base/time/time.h"
#include "base/timer/timer.h"
#include "net/base/net_errors.h"
namespace domain_reliability {
namespace {
const struct NetErrorMapping { … } net_error_map[] = …;
bool CanReportFullBeaconURLToCollector(const GURL& beacon_url,
const GURL& collector_url) { … }
}
bool GetDomainReliabilityBeaconStatus(
int net_error,
int http_response_code,
std::string* beacon_status_out) { … }
std::string GetDomainReliabilityProtocol(
net::HttpConnectionInfo connection_info,
bool ssl_info_populated) { … }
DomainReliabilityUploader::UploadResult GetUploadResultFromResponseDetails(
int net_error,
int http_response_code,
base::TimeDelta retry_after) { … }
GURL SanitizeURLForReport(
const GURL& beacon_url,
const GURL& collector_url,
const std::vector<std::unique_ptr<std::string>>& path_prefixes) { … }
namespace {
class ActualTimer : public MockableTime::Timer { … };
}
MockableTime::Timer::~Timer() { … }
MockableTime::Timer::Timer() { … }
MockableTime::~MockableTime() { … }
MockableTime::MockableTime() { … }
ActualTime::ActualTime() { … }
ActualTime::~ActualTime() { … }
base::Time ActualTime::Now() const { … }
base::TimeTicks ActualTime::NowTicks() const { … }
std::unique_ptr<MockableTime::Timer> ActualTime::CreateTimer() { … }
const base::TickClock* ActualTime::AsTickClock() const { … }
}