| 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 <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "base/time/time.h" | 14 #include "base/time/time.h" |
| 15 #include "net/base/completion_callback.h" | 15 #include "net/base/completion_callback.h" |
| 16 #include "net/base/load_states.h" | 16 #include "net/base/load_states.h" |
| 17 #include "net/base/net_export.h" | 17 #include "net/base/net_export.h" |
| 18 #include "net/base/request_priority.h" | 18 #include "net/base/request_priority.h" |
| 19 #include "net/dns/host_resolver.h" | 19 #include "net/dns/host_resolver.h" |
| 20 | 20 |
| 21 namespace base { | 21 namespace base { |
| 22 class DictionaryValue; | 22 class DictionaryValue; |
| 23 namespace trace_event { |
| 24 class MemoryAllocatorDump; |
| 25 } |
| 23 } | 26 } |
| 24 | 27 |
| 25 namespace net { | 28 namespace net { |
| 26 | 29 |
| 27 class ClientSocketHandle; | 30 class ClientSocketHandle; |
| 28 class NetLogWithSource; | 31 class NetLogWithSource; |
| 29 class StreamSocket; | 32 class StreamSocket; |
| 30 | 33 |
| 31 // ClientSocketPools are layered. This defines an interface for lower level | 34 // ClientSocketPools are layered. This defines an interface for lower level |
| 32 // socket pools to communicate with higher layer pools. | 35 // socket pools to communicate with higher layer pools. |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 | 168 |
| 166 // Retrieves information on the current state of the pool as a | 169 // Retrieves information on the current state of the pool as a |
| 167 // DictionaryValue. | 170 // DictionaryValue. |
| 168 // If |include_nested_pools| is true, the states of any nested | 171 // If |include_nested_pools| is true, the states of any nested |
| 169 // ClientSocketPools will be included. | 172 // ClientSocketPools will be included. |
| 170 virtual std::unique_ptr<base::DictionaryValue> GetInfoAsValue( | 173 virtual std::unique_ptr<base::DictionaryValue> GetInfoAsValue( |
| 171 const std::string& name, | 174 const std::string& name, |
| 172 const std::string& type, | 175 const std::string& type, |
| 173 bool include_nested_pools) const = 0; | 176 bool include_nested_pools) const = 0; |
| 174 | 177 |
| 178 virtual void PopulateAllocatorDump( |
| 179 base::trace_event::MemoryAllocatorDump* dump) const; |
| 180 |
| 175 // Returns the maximum amount of time to wait before retrying a connect. | 181 // Returns the maximum amount of time to wait before retrying a connect. |
| 176 static const int kMaxConnectRetryIntervalMs = 250; | 182 static const int kMaxConnectRetryIntervalMs = 250; |
| 177 | 183 |
| 178 static base::TimeDelta unused_idle_socket_timeout(); | 184 static base::TimeDelta unused_idle_socket_timeout(); |
| 179 static void set_unused_idle_socket_timeout(base::TimeDelta timeout); | 185 static void set_unused_idle_socket_timeout(base::TimeDelta timeout); |
| 180 | 186 |
| 181 static base::TimeDelta used_idle_socket_timeout(); | 187 static base::TimeDelta used_idle_socket_timeout(); |
| 182 static void set_used_idle_socket_timeout(base::TimeDelta timeout); | 188 static void set_used_idle_socket_timeout(base::TimeDelta timeout); |
| 183 | 189 |
| 184 protected: | 190 protected: |
| (...skipping 13 matching lines...) Expand all Loading... |
| 198 const std::string& group_name, | 204 const std::string& group_name, |
| 199 const scoped_refptr<typename PoolType::SocketParams>& params, | 205 const scoped_refptr<typename PoolType::SocketParams>& params, |
| 200 int num_sockets, | 206 int num_sockets, |
| 201 const NetLogWithSource& net_log) { | 207 const NetLogWithSource& net_log) { |
| 202 pool->RequestSockets(group_name, ¶ms, num_sockets, net_log); | 208 pool->RequestSockets(group_name, ¶ms, num_sockets, net_log); |
| 203 } | 209 } |
| 204 | 210 |
| 205 } // namespace net | 211 } // namespace net |
| 206 | 212 |
| 207 #endif // NET_SOCKET_CLIENT_SOCKET_POOL_H_ | 213 #endif // NET_SOCKET_CLIENT_SOCKET_POOL_H_ |
| OLD | NEW |