diff options
Diffstat (limited to 'net/socket/client_socket_pool.h')
-rw-r--r-- | net/socket/client_socket_pool.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/net/socket/client_socket_pool.h b/net/socket/client_socket_pool.h index ffb34b7..2c55e91 100644 --- a/net/socket/client_socket_pool.h +++ b/net/socket/client_socket_pool.h @@ -91,6 +91,22 @@ class ClientSocketPool : public base::RefCounted<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 link time error stating that +// CheckIsValidSocketParamsForPool with those template parameters is undefined. +template <typename PoolType, typename SocketParams> +void CheckIsValidSocketParamsForPool(); + +// Provides an empty definition for CheckIsValidSocketParamsForPool() which +// should be optimized out by the compiler. +#define REGISTER_SOCKET_PARAMS_FOR_POOL(pool_type, socket_params) \ +template<> \ +inline void CheckIsValidSocketParamsForPool<pool_type, socket_params>() {} + } // namespace net #endif // NET_SOCKET_CLIENT_SOCKET_POOL_H_ |