chromium/services/network/ip_protection/ip_protection_proxy_list_manager_impl.cc

// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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 {

// Default Geo used until caching by geo is enabled.
constexpr char kDefaultGeo[] =;

// Based on the logic in the `IpProtectionProxyConfigFetcher`, if there is a
// non-empty proxy list with an empty `GeoHint`, it would be considered a failed
// call which means a `proxy_list` with a value of `std::nullopt` would be
// returned. Thus, the following function captures all states of failure
// accurately even though we only check the `proxy_chain`.
void RecordTelemetry(
    const std::optional<std::vector<net::ProxyChain>>& proxy_list,
    base::TimeDelta duration) {}

}  // namespace

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) {}
}  // namespace network