Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(114)

Side by Side Diff: net/socket/client_socket_pool.h

Issue 14471023: Refactor pooled socket request code to prepare for implementation of pretend-to-preconnect. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: don't overload SSLSocketParams c-tor Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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, &params, 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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698