diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-16 00:49:00 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-16 00:49:00 +0000 |
commit | 81cdfcd5d551d8d581952a27ae968803ad856a39 (patch) | |
tree | 6f3806fb275ea36dddd43bd9d6efff96a93a2c77 /net/socket/client_socket_pool.h | |
parent | d770c84f903bd2058e33c6635c553f22c455efd3 (diff) | |
download | chromium_src-81cdfcd5d551d8d581952a27ae968803ad856a39.zip chromium_src-81cdfcd5d551d8d581952a27ae968803ad856a39.tar.gz chromium_src-81cdfcd5d551d8d581952a27ae968803ad856a39.tar.bz2 |
Plumb up the preconnect logic from pools to StreamFactory.
BUG=54450
TEST=none
Review URL: http://codereview.chromium.org/3750009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62827 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket/client_socket_pool.h')
-rw-r--r-- | net/socket/client_socket_pool.h | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/net/socket/client_socket_pool.h b/net/socket/client_socket_pool.h index d097c0f..23bb63f 100644 --- a/net/socket/client_socket_pool.h +++ b/net/socket/client_socket_pool.h @@ -149,12 +149,13 @@ class ClientSocketPool { DISALLOW_COPY_AND_ASSIGN(ClientSocketPool); }; -// Declaration, but no definition. ClientSocketPool subclasses should indicate -// valid SocketParams via the REGISTER_SOCKET_PARAMS_FOR_POOL macro below, which -// will provide a definition of CheckIsValidSocketParamsForPool for the -// ClientSocketPool subtype and SocketParams pair. Trying to use a SocketParams -// type that has not been registered with the corresponding ClientSocketPool -// subtype will result in a compile-time error. +// ClientSocketPool subclasses should indicate valid SocketParams via the +// REGISTER_SOCKET_PARAMS_FOR_POOL macro below. By default, any given +// <PoolType,SocketParams> pair will have its SocketParamsTrait inherit from +// base::false_type, but REGISTER_SOCKET_PARAMS_FOR_POOL will specialize that +// pairing to inherit from base::true_type. This provides compile time +// verification that the correct SocketParams type is used with the appropriate +// PoolType. template <typename PoolType, typename SocketParams> struct SocketParamTraits : public base::false_type { }; @@ -176,6 +177,16 @@ struct SocketParamTraits<pool_type, scoped_refptr<socket_params> > \ : public base::true_type { \ } +template <typename PoolType, typename SocketParams> +void RequestSocketsForPool(PoolType* pool, + const std::string& group_name, + const scoped_refptr<SocketParams>& params, + int num_sockets, + const BoundNetLog& net_log) { + CheckIsValidSocketParamsForPool<PoolType, SocketParams>(); + pool->RequestSockets(group_name, ¶ms, num_sockets, net_log); +} + } // namespace net #endif // NET_SOCKET_CLIENT_SOCKET_POOL_H_ |