#include "services/network/ip_protection/ip_protection_proxy_list_manager_impl.h"
#include <memory>
#include <optional>
#include "base/metrics/histogram_functions.h"
#include "base/task/task_traits.h"
#include "base/task/thread_pool.h"
#include "base/time/time.h"
#include "components/ip_protection/common/ip_protection_data_types.h"
#include "components/ip_protection/common/ip_protection_telemetry.h"
#include "net/base/features.h"
#include "net/base/proxy_chain.h"
#include "services/network/ip_protection/ip_protection_config_cache.h"
#include "services/network/ip_protection/ip_protection_geo_utils.h"
namespace network {
namespace {
constexpr char kDefaultGeo[] = …;
void RecordTelemetry(
const std::optional<std::vector<net::ProxyChain>>& proxy_list,
base::TimeDelta duration) { … }
}
IpProtectionProxyListManagerImpl::IpProtectionProxyListManagerImpl(
IpProtectionConfigCache* config_cache,
IpProtectionConfigGetter& config_getter,
bool disable_proxy_refreshing_for_testing)
: … { … }
IpProtectionProxyListManagerImpl::~IpProtectionProxyListManagerImpl() = default;
bool IpProtectionProxyListManagerImpl::IsProxyListAvailable() { … }
const std::vector<net::ProxyChain>&
IpProtectionProxyListManagerImpl::ProxyList() { … }
const std::string& IpProtectionProxyListManagerImpl::CurrentGeo() { … }
void IpProtectionProxyListManagerImpl::RefreshProxyListForGeoChange() { … }
void IpProtectionProxyListManagerImpl::RequestRefreshProxyList() { … }
void IpProtectionProxyListManagerImpl::RefreshProxyList() { … }
void IpProtectionProxyListManagerImpl::OnGotProxyList(
const base::TimeTicks refresh_start_time_for_metrics,
const std::optional<std::vector<net::ProxyChain>> proxy_list,
const std::optional<ip_protection::GeoHint> geo_hint) { … }
bool IpProtectionProxyListManagerImpl::IsProxyListOlderThanMinAge() const { … }
void IpProtectionProxyListManagerImpl::ScheduleRefreshProxyList(
base::TimeDelta delay) { … }
}