| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_BASE_H_ | 5 #ifndef NET_SOCKET_CLIENT_SOCKET_POOL_BASE_H_ |
| 6 #define NET_SOCKET_CLIENT_SOCKET_POOL_BASE_H_ | 6 #define NET_SOCKET_CLIENT_SOCKET_POOL_BASE_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 // a time. It also maintains a list of idle persistent sockets. | 85 // a time. It also maintains a list of idle persistent sockets. |
| 86 // | 86 // |
| 87 class ClientSocketPoolBase | 87 class ClientSocketPoolBase |
| 88 : public base::RefCounted<ClientSocketPoolBase>, | 88 : public base::RefCounted<ClientSocketPoolBase>, |
| 89 public ConnectJob::Delegate { | 89 public ConnectJob::Delegate { |
| 90 public: | 90 public: |
| 91 // A Request is allocated per call to RequestSocket that results in | 91 // A Request is allocated per call to RequestSocket that results in |
| 92 // ERR_IO_PENDING. | 92 // ERR_IO_PENDING. |
| 93 struct Request { | 93 struct Request { |
| 94 // HostResolver::RequestInfo has no default constructor, so fudge something. | 94 // HostResolver::RequestInfo has no default constructor, so fudge something. |
| 95 Request() : resolve_info(std::string(), 0) {} | 95 Request() |
| 96 : handle(NULL), |
| 97 callback(NULL), |
| 98 priority(0), |
| 99 resolve_info(std::string(), 0) {} |
| 96 | 100 |
| 97 Request(ClientSocketHandle* handle, | 101 Request(ClientSocketHandle* handle, |
| 98 CompletionCallback* callback, | 102 CompletionCallback* callback, |
| 99 int priority, | 103 int priority, |
| 100 const HostResolver::RequestInfo& resolve_info) | 104 const HostResolver::RequestInfo& resolve_info) |
| 101 : handle(handle), callback(callback), priority(priority), | 105 : handle(handle), callback(callback), priority(priority), |
| 102 resolve_info(resolve_info) { | 106 resolve_info(resolve_info) { |
| 103 } | 107 } |
| 104 | 108 |
| 105 ClientSocketHandle* handle; | 109 ClientSocketHandle* handle; |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 const int max_sockets_per_group_; | 256 const int max_sockets_per_group_; |
| 253 | 257 |
| 254 const scoped_ptr<ConnectJobFactory> connect_job_factory_; | 258 const scoped_ptr<ConnectJobFactory> connect_job_factory_; |
| 255 | 259 |
| 256 DISALLOW_COPY_AND_ASSIGN(ClientSocketPoolBase); | 260 DISALLOW_COPY_AND_ASSIGN(ClientSocketPoolBase); |
| 257 }; | 261 }; |
| 258 | 262 |
| 259 } // namespace net | 263 } // namespace net |
| 260 | 264 |
| 261 #endif // NET_SOCKET_CLIENT_SOCKET_POOL_BASE_H_ | 265 #endif // NET_SOCKET_CLIENT_SOCKET_POOL_BASE_H_ |
| OLD | NEW |