#include "services/network/throttling/throttling_controller.h"
#include <memory>
#include "base/no_destructor.h"
#include "net/http/http_request_info.h"
#include "services/network/throttling/network_conditions.h"
#include "services/network/throttling/scoped_throttling_token.h"
#include "services/network/throttling/throttling_network_interceptor.h"
#if BUILDFLAG(IS_P2P_ENABLED)
#include "services/network/throttling/throttling_p2p_network_interceptor.h"
#endif
namespace network {
ThrottlingController::ThrottlingController() = default;
ThrottlingController::~ThrottlingController() = default;
ThrottlingController& ThrottlingController::instance() { … }
void ThrottlingController::SetConditions(
const base::UnguessableToken& throttling_profile_id,
std::unique_ptr<NetworkConditions> conditions) { … }
ThrottlingNetworkInterceptor* ThrottlingController::GetInterceptor(
uint32_t net_log_source_id) { … }
#if BUILDFLAG(IS_P2P_ENABLED)
ThrottlingP2PNetworkInterceptor* ThrottlingController::GetP2PInterceptor(
uint32_t net_log_source_id) { … }
#endif
void ThrottlingController::RegisterProfileIDForNetLogSource(
uint32_t net_log_source_id,
const base::UnguessableToken& throttling_profile_id) { … }
void ThrottlingController::UnregisterNetLogSource(uint32_t net_log_source_id) { … }
void ThrottlingController::Register(
uint32_t net_log_source_id,
const base::UnguessableToken& throttling_profile_id) { … }
void ThrottlingController::Unregister(uint32_t net_log_source_id) { … }
std::optional<base::UnguessableToken> ThrottlingController::GetProfileID(
uint32_t net_log_source_id) { … }
void ThrottlingController::SetNetworkConditions(
const base::UnguessableToken& throttling_profile_id,
std::unique_ptr<NetworkConditions> conditions) { … }
ThrottlingNetworkInterceptor* ThrottlingController::FindInterceptor(
uint32_t net_log_source_id) { … }
#if BUILDFLAG(IS_P2P_ENABLED)
ThrottlingP2PNetworkInterceptor* ThrottlingController::FindP2PInterceptor(
uint32_t net_log_source_id) { … }
#endif
}