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

Side by Side Diff: net/http/http_proxy_client_socket_pool.h

Issue 8803019: Revert of 112134 of Revert 112130 - Close idle connections / SPDY sessions when needed. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years 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 | Annotate | Revision Log
OLDNEW
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_HTTP_HTTP_PROXY_CLIENT_SOCKET_POOL_H_ 5 #ifndef NET_HTTP_HTTP_PROXY_CLIENT_SOCKET_POOL_H_
6 #define NET_HTTP_HTTP_PROXY_CLIENT_SOCKET_POOL_H_ 6 #define NET_HTTP_HTTP_PROXY_CLIENT_SOCKET_POOL_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 scoped_ptr<ProxyClientSocket> transport_socket_; 160 scoped_ptr<ProxyClientSocket> transport_socket_;
161 bool using_spdy_; 161 bool using_spdy_;
162 162
163 HttpResponseInfo error_response_info_; 163 HttpResponseInfo error_response_info_;
164 164
165 scoped_refptr<SpdyStream> spdy_stream_; 165 scoped_refptr<SpdyStream> spdy_stream_;
166 166
167 DISALLOW_COPY_AND_ASSIGN(HttpProxyConnectJob); 167 DISALLOW_COPY_AND_ASSIGN(HttpProxyConnectJob);
168 }; 168 };
169 169
170 class NET_EXPORT_PRIVATE HttpProxyClientSocketPool : public ClientSocketPool { 170 class NET_EXPORT_PRIVATE HttpProxyClientSocketPool
171 : public ClientSocketPool, public LayeredPool {
171 public: 172 public:
172 HttpProxyClientSocketPool( 173 HttpProxyClientSocketPool(
173 int max_sockets, 174 int max_sockets,
174 int max_sockets_per_group, 175 int max_sockets_per_group,
175 ClientSocketPoolHistograms* histograms, 176 ClientSocketPoolHistograms* histograms,
176 HostResolver* host_resolver, 177 HostResolver* host_resolver,
177 TransportClientSocketPool* transport_pool, 178 TransportClientSocketPool* transport_pool,
178 SSLClientSocketPool* ssl_pool, 179 SSLClientSocketPool* ssl_pool,
179 NetLog* net_log); 180 NetLog* net_log);
180 181
(...skipping 14 matching lines...) Expand all
195 196
196 virtual void CancelRequest(const std::string& group_name, 197 virtual void CancelRequest(const std::string& group_name,
197 ClientSocketHandle* handle) OVERRIDE; 198 ClientSocketHandle* handle) OVERRIDE;
198 199
199 virtual void ReleaseSocket(const std::string& group_name, 200 virtual void ReleaseSocket(const std::string& group_name,
200 StreamSocket* socket, 201 StreamSocket* socket,
201 int id) OVERRIDE; 202 int id) OVERRIDE;
202 203
203 virtual void Flush() OVERRIDE; 204 virtual void Flush() OVERRIDE;
204 205
206 virtual bool IsStalled() const OVERRIDE;
207
205 virtual void CloseIdleSockets() OVERRIDE; 208 virtual void CloseIdleSockets() OVERRIDE;
206 209
207 virtual int IdleSocketCount() const OVERRIDE; 210 virtual int IdleSocketCount() const OVERRIDE;
208 211
209 virtual int IdleSocketCountInGroup( 212 virtual int IdleSocketCountInGroup(
210 const std::string& group_name) const OVERRIDE; 213 const std::string& group_name) const OVERRIDE;
211 214
212 virtual LoadState GetLoadState( 215 virtual LoadState GetLoadState(
213 const std::string& group_name, 216 const std::string& group_name,
214 const ClientSocketHandle* handle) const OVERRIDE; 217 const ClientSocketHandle* handle) const OVERRIDE;
215 218
219 virtual void AddLayeredPool(LayeredPool* layered_pool) OVERRIDE;
220
221 virtual void RemoveLayeredPool(LayeredPool* layered_pool) OVERRIDE;
222
216 virtual base::DictionaryValue* GetInfoAsValue( 223 virtual base::DictionaryValue* GetInfoAsValue(
217 const std::string& name, 224 const std::string& name,
218 const std::string& type, 225 const std::string& type,
219 bool include_nested_pools) const OVERRIDE; 226 bool include_nested_pools) const OVERRIDE;
220 227
221 virtual base::TimeDelta ConnectionTimeout() const OVERRIDE; 228 virtual base::TimeDelta ConnectionTimeout() const OVERRIDE;
222 229
223 virtual ClientSocketPoolHistograms* histograms() const OVERRIDE; 230 virtual ClientSocketPoolHistograms* histograms() const OVERRIDE;
224 231
232 // LayeredPool methods:
233 virtual bool CloseOneIdleConnection() OVERRIDE;
234
225 private: 235 private:
226 typedef ClientSocketPoolBase<HttpProxySocketParams> PoolBase; 236 typedef ClientSocketPoolBase<HttpProxySocketParams> PoolBase;
227 237
228 class HttpProxyConnectJobFactory : public PoolBase::ConnectJobFactory { 238 class HttpProxyConnectJobFactory : public PoolBase::ConnectJobFactory {
229 public: 239 public:
230 HttpProxyConnectJobFactory( 240 HttpProxyConnectJobFactory(
231 TransportClientSocketPool* transport_pool, 241 TransportClientSocketPool* transport_pool,
232 SSLClientSocketPool* ssl_pool, 242 SSLClientSocketPool* ssl_pool,
233 HostResolver* host_resolver, 243 HostResolver* host_resolver,
234 NetLog* net_log); 244 NetLog* net_log);
(...skipping 24 matching lines...) Expand all
259 269
260 DISALLOW_COPY_AND_ASSIGN(HttpProxyClientSocketPool); 270 DISALLOW_COPY_AND_ASSIGN(HttpProxyClientSocketPool);
261 }; 271 };
262 272
263 REGISTER_SOCKET_PARAMS_FOR_POOL(HttpProxyClientSocketPool, 273 REGISTER_SOCKET_PARAMS_FOR_POOL(HttpProxyClientSocketPool,
264 HttpProxySocketParams); 274 HttpProxySocketParams);
265 275
266 } // namespace net 276 } // namespace net
267 277
268 #endif // NET_HTTP_HTTP_PROXY_CLIENT_SOCKET_POOL_H_ 278 #endif // NET_HTTP_HTTP_PROXY_CLIENT_SOCKET_POOL_H_
OLDNEW
« no previous file with comments | « net/http/http_network_transaction_unittest.cc ('k') | net/http/http_proxy_client_socket_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698