From 81cdfcd5d551d8d581952a27ae968803ad856a39 Mon Sep 17 00:00:00 2001 From: "willchan@chromium.org" Date: Sat, 16 Oct 2010 00:49:00 +0000 Subject: 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 --- net/socket/client_socket_pool.h | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'net/socket') 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 +// 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 struct SocketParamTraits : public base::false_type { }; @@ -176,6 +177,16 @@ struct SocketParamTraits > \ : public base::true_type { \ } +template +void RequestSocketsForPool(PoolType* pool, + const std::string& group_name, + const scoped_refptr& params, + int num_sockets, + const BoundNetLog& net_log) { + CheckIsValidSocketParamsForPool(); + pool->RequestSockets(group_name, ¶ms, num_sockets, net_log); +} + } // namespace net #endif // NET_SOCKET_CLIENT_SOCKET_POOL_H_ -- cgit v1.1