| 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_TRANSPORT_CLIENT_SOCKET_POOL_H_ | 5 #ifndef NET_SOCKET_TRANSPORT_CLIENT_SOCKET_POOL_H_ |
| 6 #define NET_SOCKET_TRANSPORT_CLIENT_SOCKET_POOL_H_ | 6 #define NET_SOCKET_TRANSPORT_CLIENT_SOCKET_POOL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 TransportClientSocketPool( | 133 TransportClientSocketPool( |
| 134 int max_sockets, | 134 int max_sockets, |
| 135 int max_sockets_per_group, | 135 int max_sockets_per_group, |
| 136 ClientSocketPoolHistograms* histograms, | 136 ClientSocketPoolHistograms* histograms, |
| 137 HostResolver* host_resolver, | 137 HostResolver* host_resolver, |
| 138 ClientSocketFactory* client_socket_factory, | 138 ClientSocketFactory* client_socket_factory, |
| 139 NetLog* net_log); | 139 NetLog* net_log); |
| 140 | 140 |
| 141 virtual ~TransportClientSocketPool(); | 141 virtual ~TransportClientSocketPool(); |
| 142 | 142 |
| 143 // ClientSocketPool methods: | 143 // ClientSocketPool implementation. |
| 144 | |
| 145 virtual int RequestSocket(const std::string& group_name, | 144 virtual int RequestSocket(const std::string& group_name, |
| 146 const void* resolve_info, | 145 const void* resolve_info, |
| 147 RequestPriority priority, | 146 RequestPriority priority, |
| 148 ClientSocketHandle* handle, | 147 ClientSocketHandle* handle, |
| 149 OldCompletionCallback* callback, | 148 const CompletionCallback& callback, |
| 150 const BoundNetLog& net_log) OVERRIDE; | 149 const BoundNetLog& net_log) OVERRIDE; |
| 151 | |
| 152 virtual void RequestSockets(const std::string& group_name, | 150 virtual void RequestSockets(const std::string& group_name, |
| 153 const void* params, | 151 const void* params, |
| 154 int num_sockets, | 152 int num_sockets, |
| 155 const BoundNetLog& net_log) OVERRIDE; | 153 const BoundNetLog& net_log) OVERRIDE; |
| 156 | |
| 157 virtual void CancelRequest(const std::string& group_name, | 154 virtual void CancelRequest(const std::string& group_name, |
| 158 ClientSocketHandle* handle) OVERRIDE; | 155 ClientSocketHandle* handle) OVERRIDE; |
| 159 | |
| 160 virtual void ReleaseSocket(const std::string& group_name, | 156 virtual void ReleaseSocket(const std::string& group_name, |
| 161 StreamSocket* socket, | 157 StreamSocket* socket, |
| 162 int id) OVERRIDE; | 158 int id) OVERRIDE; |
| 163 | |
| 164 virtual void Flush() OVERRIDE; | 159 virtual void Flush() OVERRIDE; |
| 165 | |
| 166 virtual bool IsStalled() const OVERRIDE; | 160 virtual bool IsStalled() const OVERRIDE; |
| 167 | |
| 168 virtual void CloseIdleSockets() OVERRIDE; | 161 virtual void CloseIdleSockets() OVERRIDE; |
| 169 | |
| 170 virtual int IdleSocketCount() const OVERRIDE; | 162 virtual int IdleSocketCount() const OVERRIDE; |
| 171 | |
| 172 virtual int IdleSocketCountInGroup( | 163 virtual int IdleSocketCountInGroup( |
| 173 const std::string& group_name) const OVERRIDE; | 164 const std::string& group_name) const OVERRIDE; |
| 174 | |
| 175 virtual LoadState GetLoadState( | 165 virtual LoadState GetLoadState( |
| 176 const std::string& group_name, | 166 const std::string& group_name, |
| 177 const ClientSocketHandle* handle) const OVERRIDE; | 167 const ClientSocketHandle* handle) const OVERRIDE; |
| 178 | |
| 179 virtual void AddLayeredPool(LayeredPool* layered_pool) OVERRIDE; | 168 virtual void AddLayeredPool(LayeredPool* layered_pool) OVERRIDE; |
| 180 | |
| 181 virtual void RemoveLayeredPool(LayeredPool* layered_pool) OVERRIDE; | 169 virtual void RemoveLayeredPool(LayeredPool* layered_pool) OVERRIDE; |
| 182 | |
| 183 virtual base::DictionaryValue* GetInfoAsValue( | 170 virtual base::DictionaryValue* GetInfoAsValue( |
| 184 const std::string& name, | 171 const std::string& name, |
| 185 const std::string& type, | 172 const std::string& type, |
| 186 bool include_nested_pools) const OVERRIDE; | 173 bool include_nested_pools) const OVERRIDE; |
| 187 | |
| 188 virtual base::TimeDelta ConnectionTimeout() const OVERRIDE; | 174 virtual base::TimeDelta ConnectionTimeout() const OVERRIDE; |
| 189 | |
| 190 virtual ClientSocketPoolHistograms* histograms() const OVERRIDE; | 175 virtual ClientSocketPoolHistograms* histograms() const OVERRIDE; |
| 191 | 176 |
| 192 private: | 177 private: |
| 193 typedef ClientSocketPoolBase<TransportSocketParams> PoolBase; | 178 typedef ClientSocketPoolBase<TransportSocketParams> PoolBase; |
| 194 | 179 |
| 195 class TransportConnectJobFactory | 180 class TransportConnectJobFactory |
| 196 : public PoolBase::ConnectJobFactory { | 181 : public PoolBase::ConnectJobFactory { |
| 197 public: | 182 public: |
| 198 TransportConnectJobFactory(ClientSocketFactory* client_socket_factory, | 183 TransportConnectJobFactory(ClientSocketFactory* client_socket_factory, |
| 199 HostResolver* host_resolver, | 184 HostResolver* host_resolver, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 225 | 210 |
| 226 DISALLOW_COPY_AND_ASSIGN(TransportClientSocketPool); | 211 DISALLOW_COPY_AND_ASSIGN(TransportClientSocketPool); |
| 227 }; | 212 }; |
| 228 | 213 |
| 229 REGISTER_SOCKET_PARAMS_FOR_POOL(TransportClientSocketPool, | 214 REGISTER_SOCKET_PARAMS_FOR_POOL(TransportClientSocketPool, |
| 230 TransportSocketParams); | 215 TransportSocketParams); |
| 231 | 216 |
| 232 } // namespace net | 217 } // namespace net |
| 233 | 218 |
| 234 #endif // NET_SOCKET_TRANSPORT_CLIENT_SOCKET_POOL_H_ | 219 #endif // NET_SOCKET_TRANSPORT_CLIENT_SOCKET_POOL_H_ |
| OLD | NEW |