#include "net/http/http_stream_factory.h"
#include <cstddef>
#include <tuple>
#include <utility>
#include <vector>
#include "base/check.h"
#include "base/metrics/histogram_macros.h"
#include "base/notreached.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/time/time.h"
#include "net/base/host_mapping_rules.h"
#include "net/base/host_port_pair.h"
#include "net/base/load_flags.h"
#include "net/base/network_anonymization_key.h"
#include "net/base/network_isolation_key.h"
#include "net/base/parse_number.h"
#include "net/base/port_util.h"
#include "net/base/privacy_mode.h"
#include "net/base/upload_data_stream.h"
#include "net/dns/public/secure_dns_policy.h"
#include "net/http/http_network_session.h"
#include "net/http/http_response_headers.h"
#include "net/http/http_server_properties.h"
#include "net/http/http_stream_factory_job.h"
#include "net/http/http_stream_factory_job_controller.h"
#include "net/http/transport_security_state.h"
#include "net/quic/quic_http_utils.h"
#include "net/socket/socket_tag.h"
#include "net/spdy/bidirectional_stream_spdy_impl.h"
#include "net/spdy/spdy_http_stream.h"
#include "net/ssl/ssl_config.h"
#include "net/third_party/quiche/src/quiche/quic/core/quic_packets.h"
#include "net/third_party/quiche/src/quiche/quic/core/quic_server_id.h"
#include "net/third_party/quiche/src/quiche/spdy/core/spdy_alt_svc_wire_format.h"
#include "url/gurl.h"
#include "url/scheme_host_port.h"
#include "url/url_constants.h"
namespace net {
namespace {
const char kAlternativeServiceHeader[] = …;
}
SpdySessionKey HttpStreamFactory::GetSpdySessionKey(
const ProxyChain& proxy_chain,
const GURL& origin_url,
const StreamRequestInfo& request_info) { … }
bool HttpStreamFactory::IsGetToProxy(const ProxyChain& proxy_chain,
const GURL& origin_url) { … }
HttpStreamFactory::StreamRequestInfo::StreamRequestInfo() = default;
HttpStreamFactory::StreamRequestInfo::StreamRequestInfo(
const HttpRequestInfo& http_request_info)
: … { … }
HttpStreamFactory::StreamRequestInfo::StreamRequestInfo(
const StreamRequestInfo& other) = default;
HttpStreamFactory::StreamRequestInfo&
HttpStreamFactory::StreamRequestInfo::operator=(
const StreamRequestInfo& other) = default;
HttpStreamFactory::StreamRequestInfo::StreamRequestInfo(
StreamRequestInfo&& other) = default;
HttpStreamFactory::StreamRequestInfo&
HttpStreamFactory::StreamRequestInfo::operator=(StreamRequestInfo&& other) =
default;
HttpStreamFactory::StreamRequestInfo::~StreamRequestInfo() = default;
HttpStreamFactory::HttpStreamFactory(HttpNetworkSession* session)
: … { … }
HttpStreamFactory::~HttpStreamFactory() = default;
void HttpStreamFactory::ProcessAlternativeServices(
HttpNetworkSession* session,
const NetworkAnonymizationKey& network_anonymization_key,
const HttpResponseHeaders* headers,
const url::SchemeHostPort& http_server) { … }
url::SchemeHostPort HttpStreamFactory::RewriteHost(
const url::SchemeHostPort& server) { … }
std::unique_ptr<HttpStreamRequest> HttpStreamFactory::RequestStream(
const HttpRequestInfo& request_info,
RequestPriority priority,
const std::vector<SSLConfig::CertAndStatus>& allowed_bad_certs,
HttpStreamRequest::Delegate* delegate,
bool enable_ip_based_pooling,
bool enable_alternative_services,
const NetLogWithSource& net_log) { … }
std::unique_ptr<HttpStreamRequest>
HttpStreamFactory::RequestWebSocketHandshakeStream(
const HttpRequestInfo& request_info,
RequestPriority priority,
const std::vector<SSLConfig::CertAndStatus>& allowed_bad_certs,
HttpStreamRequest::Delegate* delegate,
WebSocketHandshakeStreamBase::CreateHelper* create_helper,
bool enable_ip_based_pooling,
bool enable_alternative_services,
const NetLogWithSource& net_log) { … }
std::unique_ptr<HttpStreamRequest>
HttpStreamFactory::RequestBidirectionalStreamImpl(
const HttpRequestInfo& request_info,
RequestPriority priority,
const std::vector<SSLConfig::CertAndStatus>& allowed_bad_certs,
HttpStreamRequest::Delegate* delegate,
bool enable_ip_based_pooling,
bool enable_alternative_services,
const NetLogWithSource& net_log) { … }
std::unique_ptr<HttpStreamRequest> HttpStreamFactory::RequestStreamInternal(
const HttpRequestInfo& request_info,
RequestPriority priority,
const std::vector<SSLConfig::CertAndStatus>& allowed_bad_certs,
HttpStreamRequest::Delegate* delegate,
WebSocketHandshakeStreamBase::CreateHelper*
websocket_handshake_stream_create_helper,
HttpStreamRequest::StreamType stream_type,
bool is_websocket,
bool enable_ip_based_pooling,
bool enable_alternative_services,
const NetLogWithSource& net_log) { … }
void HttpStreamFactory::PreconnectStreams(int num_streams,
HttpRequestInfo& request_info) { … }
const HostMappingRules* HttpStreamFactory::GetHostMappingRules() const { … }
void HttpStreamFactory::OnJobControllerComplete(JobController* controller) { … }
}