summaryrefslogtreecommitdiffstats
path: root/net/socket/client_socket_pool_manager.h
diff options
context:
space:
mode:
authorsanjeevr@chromium.org <sanjeevr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-29 01:09:41 +0000
committersanjeevr@chromium.org <sanjeevr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-29 01:09:41 +0000
commit5483d30448876fd7c7c08db0517be1123b5be8f1 (patch)
treecad62333b823fcbcd04726d4c7ab51c71c80c2c5 /net/socket/client_socket_pool_manager.h
parent34338254f776be94d79ca184c4eb2ea5b3f62318 (diff)
downloadchromium_src-5483d30448876fd7c7c08db0517be1123b5be8f1.zip
chromium_src-5483d30448876fd7c7c08db0517be1123b5be8f1.tar.gz
chromium_src-5483d30448876fd7c7c08db0517be1123b5be8f1.tar.bz2
Moved the logic to initialize a ClientSocketHandle with the relevant socket pool based on the proxy information to static helpers in ClientSocketPoolManager from HttpStreamFactoryImpl::Job::DoInitConnection. This will allow us to reuse this logic for raw socket connections that need to tunnel through the proxies (for example the XMPP connection made by jingle).
BUG=None TEST=net_unittests, Test with proxy servers. R=willchan@chromium.org Review URL: http://codereview.chromium.org/6733042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79641 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket/client_socket_pool_manager.h')
-rw-r--r--net/socket/client_socket_pool_manager.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/net/socket/client_socket_pool_manager.h b/net/socket/client_socket_pool_manager.h
index 5415578..f10b012 100644
--- a/net/socket/client_socket_pool_manager.h
+++ b/net/socket/client_socket_pool_manager.h
@@ -18,21 +18,26 @@
#include "base/template_util.h"
#include "base/threading/non_thread_safe.h"
#include "net/base/cert_database.h"
+#include "net/base/completion_callback.h"
#include "net/socket/client_socket_pool_histograms.h"
class Value;
namespace net {
+class BoundNetLog;
class CertVerifier;
class ClientSocketFactory;
+class ClientSocketHandle;
class ClientSocketPoolHistograms;
class DnsCertProvenanceChecker;
class DnsRRResolver;
+class HttpNetworkSession;
class HostPortPair;
class HttpProxyClientSocketPool;
class HostResolver;
class NetLog;
+class ProxyInfo;
class ProxyService;
class SOCKSClientSocketPool;
class SSLClientSocketPool;
@@ -40,6 +45,9 @@ class SSLConfigService;
class SSLHostInfoFactory;
class TCPClientSocketPool;
+struct HttpRequestInfo;
+struct SSLConfig;
+
namespace internal {
// A helper class for auto-deleting Values in the destructor.
@@ -92,6 +100,49 @@ class ClientSocketPoolManager : public base::NonThreadSafe,
static void set_max_sockets_per_group(int socket_count);
static void set_max_sockets_per_proxy_server(int socket_count);
+ // A helper method that uses the passed in proxy information to initialize a
+ // ClientSocketHandle with the relevant socket pool. Use this method for
+ // HTTP/HTTPS requests. |ssl_config_for_origin| is only used if the request
+ // uses SSL and |ssl_config_for_proxy| is used if the proxy server is HTTPS.
+ static int InitSocketHandleForHttpRequest(
+ const HttpRequestInfo& request_info,
+ HttpNetworkSession* session,
+ const ProxyInfo& proxy_info,
+ bool force_spdy_over_ssl,
+ bool want_spdy_over_npn,
+ const SSLConfig& ssl_config_for_origin,
+ const SSLConfig& ssl_config_for_proxy,
+ const BoundNetLog& net_log,
+ ClientSocketHandle* socket_handle,
+ CompletionCallback* callback);
+
+ // A helper method that uses the passed in proxy information to initialize a
+ // ClientSocketHandle with the relevant socket pool. Use this method for
+ // a raw socket connection to a host-port pair (that needs to tunnel through
+ // the proxies).
+ static int InitSocketHandleForRawConnect(
+ const HostPortPair& host_port_pair,
+ HttpNetworkSession* session,
+ const ProxyInfo& proxy_info,
+ const SSLConfig& ssl_config_for_origin,
+ const SSLConfig& ssl_config_for_proxy,
+ const BoundNetLog& net_log,
+ ClientSocketHandle* socket_handle,
+ CompletionCallback* callback);
+
+ // Similar to InitSocketHandleForHttpRequest except that it initiates the
+ // desired number of preconnect streams from the relevant socket pool.
+ static int PreconnectSocketsForHttpRequest(
+ const HttpRequestInfo& request_info,
+ HttpNetworkSession* session,
+ const ProxyInfo& proxy_info,
+ bool force_spdy_over_ssl,
+ bool want_spdy_over_npn,
+ const SSLConfig& ssl_config_for_origin,
+ const SSLConfig& ssl_config_for_proxy,
+ const BoundNetLog& net_log,
+ int num_preconnect_streams);
+
// Creates a Value summary of the state of the socket pools. The caller is
// responsible for deleting the returned value.
Value* SocketPoolInfoToValue() const;