#include "net/socket/client_socket_pool.h"
#include <memory>
#include <string_view>
#include <utility>
#include <vector>
#include "base/check_op.h"
#include "base/feature_list.h"
#include "base/functional/bind.h"
#include "base/strings/strcat.h"
#include "net/base/features.h"
#include "net/base/host_port_pair.h"
#include "net/base/proxy_chain.h"
#include "net/base/session_usage.h"
#include "net/dns/public/secure_dns_policy.h"
#include "net/http/http_proxy_connect_job.h"
#include "net/log/net_log_event_type.h"
#include "net/log/net_log_with_source.h"
#include "net/socket/connect_job.h"
#include "net/socket/connect_job_factory.h"
#include "net/socket/socks_connect_job.h"
#include "net/socket/ssl_connect_job.h"
#include "net/socket/stream_socket.h"
#include "net/spdy/spdy_session.h"
#include "net/spdy/spdy_session_pool.h"
#include "net/ssl/ssl_config.h"
#include "url/gurl.h"
#include "url/scheme_host_port.h"
#include "url/url_constants.h"
namespace net {
namespace {
int64_t g_used_idle_socket_timeout_s = …;
OnHostResolutionCallbackResult OnHostResolution(
SpdySessionPool* spdy_session_pool,
const SpdySessionKey& spdy_session_key,
bool is_for_websockets,
const HostPortPair& host_port_pair,
const std::vector<HostResolverEndpointResult>& endpoint_results,
const std::set<std::string>& aliases) { … }
}
ClientSocketPool::SocketParams::SocketParams(
const std::vector<SSLConfig::CertAndStatus>& allowed_bad_certs)
: … { … }
ClientSocketPool::SocketParams::~SocketParams() = default;
scoped_refptr<ClientSocketPool::SocketParams>
ClientSocketPool::SocketParams::CreateForHttpForTesting() { … }
std::string_view ClientSocketPool::GroupId::GetPrivacyModeGroupIdPrefix(
PrivacyMode privacy_mode) { … }
std::string_view ClientSocketPool::GroupId::GetSecureDnsPolicyGroupIdPrefix(
SecureDnsPolicy secure_dns_policy) { … }
ClientSocketPool::GroupId::GroupId()
: … { … }
ClientSocketPool::GroupId::GroupId(
url::SchemeHostPort destination,
PrivacyMode privacy_mode,
NetworkAnonymizationKey network_anonymization_key,
SecureDnsPolicy secure_dns_policy,
bool disable_cert_network_fetches)
: … { … }
ClientSocketPool::GroupId::GroupId(const GroupId& group_id) = default;
ClientSocketPool::GroupId::~GroupId() = default;
ClientSocketPool::GroupId& ClientSocketPool::GroupId::operator=(
const GroupId& group_id) = default;
ClientSocketPool::GroupId& ClientSocketPool::GroupId::operator=(
GroupId&& group_id) = default;
std::string ClientSocketPool::GroupId::ToString() const { … }
ClientSocketPool::~ClientSocketPool() = default;
base::TimeDelta ClientSocketPool::used_idle_socket_timeout() { … }
void ClientSocketPool::set_used_idle_socket_timeout(base::TimeDelta timeout) { … }
ClientSocketPool::ClientSocketPool(
bool is_for_websockets,
const CommonConnectJobParams* common_connect_job_params,
std::unique_ptr<ConnectJobFactory> connect_job_factory)
: … { … }
void ClientSocketPool::NetLogTcpClientSocketPoolRequestedSocket(
const NetLogWithSource& net_log,
const GroupId& group_id) { … }
base::Value::Dict ClientSocketPool::NetLogGroupIdParams(
const GroupId& group_id) { … }
std::unique_ptr<ConnectJob> ClientSocketPool::CreateConnectJob(
GroupId group_id,
scoped_refptr<SocketParams> socket_params,
const ProxyChain& proxy_chain,
const std::optional<NetworkTrafficAnnotationTag>& proxy_annotation_tag,
RequestPriority request_priority,
SocketTag socket_tag,
ConnectJob::Delegate* delegate) { … }
}