From 5dc51b6ecfd712d718ed764721e43b6520b4c6ef Mon Sep 17 00:00:00 2001 From: klzgrad Date: Sat, 8 Dec 2018 00:52:08 -0500 Subject: [PATCH] socket: Add RawConnect method --- src/net/socket/client_socket_pool_manager.cc | 23 ++++++++++++++++++++ src/net/socket/client_socket_pool_manager.h | 14 ++++++++++++ 2 files changed, 37 insertions(+) diff --git a/src/net/socket/client_socket_pool_manager.cc b/src/net/socket/client_socket_pool_manager.cc index 8ca1355a34..5b44e925b9 100644 --- a/src/net/socket/client_socket_pool_manager.cc +++ b/src/net/socket/client_socket_pool_manager.cc @@ -292,6 +292,29 @@ int InitSocketHandleForWebSocketRequest( proxy_auth_callback); } +int InitSocketHandleForRawConnect2( + const HostPortPair& endpoint, + HttpNetworkSession* session, + int request_load_flags, + RequestPriority request_priority, + const ProxyInfo& proxy_info, + const SSLConfig& ssl_config_for_origin, + const SSLConfig& ssl_config_for_proxy, + PrivacyMode privacy_mode, + const NetworkIsolationKey& network_isolation_key, + const NetLogWithSource& net_log, + ClientSocketHandle* socket_handle, + CompletionOnceCallback callback) { + DCHECK(socket_handle); + return InitSocketPoolHelper( + ClientSocketPoolManager::NORMAL_GROUP, endpoint, request_load_flags, + request_priority, session, proxy_info, ssl_config_for_origin, + ssl_config_for_proxy, /*is_for_websockets=*/true, privacy_mode, + network_isolation_key, /*disable_secure_dns=*/true, SocketTag(), net_log, + 0, socket_handle, HttpNetworkSession::NORMAL_SOCKET_POOL, + std::move(callback), ClientSocketPool::ProxyAuthCallback()); +} + int PreconnectSocketsForHttpRequest( ClientSocketPoolManager::SocketGroupType group_type, const HostPortPair& endpoint, diff --git a/src/net/socket/client_socket_pool_manager.h b/src/net/socket/client_socket_pool_manager.h index 496a6e6c1c..d3c3cf3ba3 100644 --- a/src/net/socket/client_socket_pool_manager.h +++ b/src/net/socket/client_socket_pool_manager.h @@ -142,6 +142,20 @@ int InitSocketHandleForWebSocketRequest( CompletionOnceCallback callback, const ClientSocketPool::ProxyAuthCallback& proxy_auth_callback); +NET_EXPORT int InitSocketHandleForRawConnect2( + const HostPortPair& endpoint, + HttpNetworkSession* session, + int request_load_flags, + RequestPriority request_priority, + const ProxyInfo& proxy_info, + const SSLConfig& ssl_config_for_origin, + const SSLConfig& ssl_config_for_proxy, + PrivacyMode privacy_mode, + const NetworkIsolationKey& network_isolation_key, + const NetLogWithSource& net_log, + ClientSocketHandle* socket_handle, + CompletionOnceCallback callback); + // Similar to InitSocketHandleForHttpRequest except that it initiates the // desired number of preconnect streams from the relevant socket pool. int PreconnectSocketsForHttpRequest(