| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <deque> | 9 #include <deque> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 // an error with the reused socket. | 71 // an error with the reused socket. |
| 72 // | 72 // |
| 73 // If ERR_IO_PENDING is returned, then the callback will be used to notify the | 73 // If ERR_IO_PENDING is returned, then the callback will be used to notify the |
| 74 // client of completion. | 74 // client of completion. |
| 75 // | 75 // |
| 76 // Profiling information for the request is saved to |net_log| if non-NULL. | 76 // Profiling information for the request is saved to |net_log| if non-NULL. |
| 77 virtual int RequestSocket(const std::string& group_name, | 77 virtual int RequestSocket(const std::string& group_name, |
| 78 const void* params, | 78 const void* params, |
| 79 RequestPriority priority, | 79 RequestPriority priority, |
| 80 ClientSocketHandle* handle, | 80 ClientSocketHandle* handle, |
| 81 OldCompletionCallback* callback, | 81 const CompletionCallback& callback, |
| 82 const BoundNetLog& net_log) = 0; | 82 const BoundNetLog& net_log) = 0; |
| 83 | 83 |
| 84 // RequestSockets is used to request that |num_sockets| be connected in the | 84 // RequestSockets is used to request that |num_sockets| be connected in the |
| 85 // connection group for |group_name|. If the connection group already has | 85 // connection group for |group_name|. If the connection group already has |
| 86 // |num_sockets| idle sockets / active sockets / currently connecting sockets, | 86 // |num_sockets| idle sockets / active sockets / currently connecting sockets, |
| 87 // then this function doesn't do anything. Otherwise, it will start up as | 87 // then this function doesn't do anything. Otherwise, it will start up as |
| 88 // many connections as necessary to reach |num_sockets| total sockets for the | 88 // many connections as necessary to reach |num_sockets| total sockets for the |
| 89 // group. It uses |params| to control how to connect the sockets. The | 89 // group. It uses |params| to control how to connect the sockets. The |
| 90 // ClientSocketPool will assign a priority to the new connections, if any. | 90 // ClientSocketPool will assign a priority to the new connections, if any. |
| 91 // This priority will probably be lower than all others, since this method | 91 // This priority will probably be lower than all others, since this method |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 const scoped_refptr<SocketParams>& params, | 211 const scoped_refptr<SocketParams>& params, |
| 212 int num_sockets, | 212 int num_sockets, |
| 213 const BoundNetLog& net_log) { | 213 const BoundNetLog& net_log) { |
| 214 CheckIsValidSocketParamsForPool<PoolType, SocketParams>(); | 214 CheckIsValidSocketParamsForPool<PoolType, SocketParams>(); |
| 215 pool->RequestSockets(group_name, ¶ms, num_sockets, net_log); | 215 pool->RequestSockets(group_name, ¶ms, num_sockets, net_log); |
| 216 } | 216 } |
| 217 | 217 |
| 218 } // namespace net | 218 } // namespace net |
| 219 | 219 |
| 220 #endif // NET_SOCKET_CLIENT_SOCKET_POOL_H_ | 220 #endif // NET_SOCKET_CLIENT_SOCKET_POOL_H_ |
| OLD | NEW |