| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef NET_SOCKET_CLIENT_SOCKET_POOL_H_ | 5 #ifndef NET_SOCKET_CLIENT_SOCKET_POOL_H_ |
| 6 #define NET_SOCKET_CLIENT_SOCKET_POOL_H_ | 6 #define NET_SOCKET_CLIENT_SOCKET_POOL_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 } | 198 } |
| 199 | 199 |
| 200 // Provides an empty definition for CheckIsValidSocketParamsForPool() which | 200 // Provides an empty definition for CheckIsValidSocketParamsForPool() which |
| 201 // should be optimized out by the compiler. | 201 // should be optimized out by the compiler. |
| 202 #define REGISTER_SOCKET_PARAMS_FOR_POOL(pool_type, socket_params) \ | 202 #define REGISTER_SOCKET_PARAMS_FOR_POOL(pool_type, socket_params) \ |
| 203 template<> \ | 203 template<> \ |
| 204 struct SocketParamTraits<pool_type, scoped_refptr<socket_params> > \ | 204 struct SocketParamTraits<pool_type, scoped_refptr<socket_params> > \ |
| 205 : public base::true_type { \ | 205 : public base::true_type { \ |
| 206 } | 206 } |
| 207 | 207 |
| 208 template <typename PoolType, typename SocketParams> | |
| 209 void RequestSocketsForPool(PoolType* pool, | |
| 210 const std::string& group_name, | |
| 211 const scoped_refptr<SocketParams>& params, | |
| 212 int num_sockets, | |
| 213 const BoundNetLog& net_log) { | |
| 214 CheckIsValidSocketParamsForPool<PoolType, SocketParams>(); | |
| 215 pool->RequestSockets(group_name, ¶ms, num_sockets, net_log); | |
| 216 } | |
| 217 | |
| 218 } // namespace net | 208 } // namespace net |
| 219 | 209 |
| 220 #endif // NET_SOCKET_CLIENT_SOCKET_POOL_H_ | 210 #endif // NET_SOCKET_CLIENT_SOCKET_POOL_H_ |
| OLD | NEW |