chromium/net/http/http_stream_pool.cc

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

#include "net/http/http_stream_pool.h"

#include <map>
#include <memory>
#include <set>
#include <string>

#include "base/containers/flat_set.h"
#include "base/memory/weak_ptr.h"
#include "base/notreached.h"
#include "base/task/sequenced_task_runner.h"
#include "net/base/completion_once_callback.h"
#include "net/base/host_port_pair.h"
#include "net/base/load_states.h"
#include "net/base/network_change_notifier.h"
#include "net/base/proxy_chain.h"
#include "net/base/session_usage.h"
#include "net/http/http_network_session.h"
#include "net/http/http_stream_key.h"
#include "net/http/http_stream_pool_group.h"
#include "net/http/http_stream_pool_job_controller.h"
#include "net/http/http_stream_request.h"
#include "net/log/net_log_with_source.h"
#include "net/quic/quic_http_stream.h"
#include "net/quic/quic_session_pool.h"
#include "net/socket/ssl_client_socket.h"
#include "net/spdy/spdy_http_stream.h"
#include "net/spdy/spdy_session.h"
#include "url/gurl.h"

namespace net {

// An implementation of HttpStreamRequest::Helper that is used to create a
// request when the pool can immediately provide an HttpStream from existing
// QUIC/SPDY sessions. This eliminates unnecessary creation/destruction of
// Group/AttemptManager when QUIC/SPDY sessions are already available.
class HttpStreamPool::PooledStreamRequestHelper
    : public HttpStreamRequest::Helper {};

HttpStreamPool::HttpStreamPool(HttpNetworkSession* http_network_session,
                               bool cleanup_on_ip_address_change)
    :{}

HttpStreamPool::~HttpStreamPool() {}

std::unique_ptr<HttpStreamRequest> HttpStreamPool::RequestStream(
    HttpStreamRequest::Delegate* delegate,
    const HttpStreamKey& stream_key,
    RequestPriority priority,
    const std::vector<SSLConfig::CertAndStatus>& allowed_bad_certs,
    bool enable_ip_based_pooling,
    bool enable_alternative_services,
    AlternativeServiceInfo alternative_service_info,
    quic::ParsedQuicVersion quic_version,
    const NetLogWithSource& net_log) {}

int HttpStreamPool::Preconnect(const HttpStreamKey& stream_key,
                               size_t num_streams,
                               AlternativeServiceInfo alternative_service_info,
                               quic::ParsedQuicVersion quic_version,
                               CompletionOnceCallback callback) {}

void HttpStreamPool::IncrementTotalIdleStreamCount() {}

void HttpStreamPool::DecrementTotalIdleStreamCount() {}

void HttpStreamPool::IncrementTotalHandedOutStreamCount() {}

void HttpStreamPool::DecrementTotalHandedOutStreamCount() {}

void HttpStreamPool::IncrementTotalConnectingStreamCount() {}

void HttpStreamPool::DecrementTotalConnectingStreamCount(size_t amount) {}

void HttpStreamPool::OnIPAddressChanged() {}

void HttpStreamPool::OnSSLConfigChanged(
    SSLClientContext::SSLConfigChangeType change_type) {}

void HttpStreamPool::OnSSLConfigForServersChanged(
    const base::flat_set<HostPortPair>& servers) {}

void HttpStreamPool::OnGroupComplete(Group* group) {}

void HttpStreamPool::OnJobControllerComplete(JobController* job_controller) {}

void HttpStreamPool::CloseIdleStreams(
    std::string_view net_log_close_reason_utf8) {}

bool HttpStreamPool::IsPoolStalled() {}

void HttpStreamPool::ProcessPendingRequestsInGroups() {}

bool HttpStreamPool::RequiresHTTP11(const HttpStreamKey& stream_key) {}

bool HttpStreamPool::CanUseQuic(const HttpStreamKey& stream_key,
                                bool enable_ip_based_pooling,
                                bool enable_alternative_services) {}

bool HttpStreamPool::CanUseExistingQuicSession(
    const HttpStreamKey& stream_key,
    const QuicSessionKey& quic_session_key,
    bool enable_ip_based_pooling,
    bool enable_alternative_services) {}

void HttpStreamPool::SetObserverForTesting(std::unique_ptr<Observer> observer) {}

base::Value::Dict HttpStreamPool::GetInfoAsValue() const {}

HttpStreamPool::Group& HttpStreamPool::GetOrCreateGroupForTesting(
    const HttpStreamKey& stream_key) {}

HttpStreamPool::Group& HttpStreamPool::GetOrCreateGroup(
    const HttpStreamKey& stream_key) {}

HttpStreamPool::Group* HttpStreamPool::GetGroup(
    const HttpStreamKey& stream_key) {}

HttpStreamPool::Group* HttpStreamPool::FindHighestStalledGroup() {}

bool HttpStreamPool::CloseOneIdleStreamSocket() {}

base::WeakPtr<SpdySession> HttpStreamPool::FindAvailableSpdySession(
    const HttpStreamKey& stream_key,
    const SpdySessionKey& spdy_session_key,
    bool enable_ip_based_pooling,
    const NetLogWithSource& net_log) {}

std::unique_ptr<HttpStreamRequest> HttpStreamPool::CreatePooledStreamRequest(
    HttpStreamRequest::Delegate* delegate,
    std::unique_ptr<HttpStream> http_stream,
    NextProto negotiated_protocol,
    const NetLogWithSource& net_log) {}

void HttpStreamPool::OnPooledStreamRequestComplete(
    PooledStreamRequestHelper* helper) {}

}  // namespace net