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

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

Issue 18796003: When an idle socket is added back to a socket pool, check for stalled jobs in lower pools (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Undo somewhat tangential change Created 7 years, 5 months 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) 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_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 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 167
168 HttpResponseInfo error_response_info_; 168 HttpResponseInfo error_response_info_;
169 169
170 SpdyStreamRequest spdy_stream_request_; 170 SpdyStreamRequest spdy_stream_request_;
171 171
172 DISALLOW_COPY_AND_ASSIGN(HttpProxyConnectJob); 172 DISALLOW_COPY_AND_ASSIGN(HttpProxyConnectJob);
173 }; 173 };
174 174
175 class NET_EXPORT_PRIVATE HttpProxyClientSocketPool 175 class NET_EXPORT_PRIVATE HttpProxyClientSocketPool
176 : public ClientSocketPool, 176 : public ClientSocketPool,
177 public LayeredPool { 177 public HigherLayeredPool {
178 public: 178 public:
179 HttpProxyClientSocketPool( 179 HttpProxyClientSocketPool(
180 int max_sockets, 180 int max_sockets,
181 int max_sockets_per_group, 181 int max_sockets_per_group,
182 ClientSocketPoolHistograms* histograms, 182 ClientSocketPoolHistograms* histograms,
183 HostResolver* host_resolver, 183 HostResolver* host_resolver,
184 TransportClientSocketPool* transport_pool, 184 TransportClientSocketPool* transport_pool,
185 SSLClientSocketPool* ssl_pool, 185 SSLClientSocketPool* ssl_pool,
186 NetLog* net_log); 186 NetLog* net_log);
187 187
(...skipping 14 matching lines...) Expand all
202 202
203 virtual void CancelRequest(const std::string& group_name, 203 virtual void CancelRequest(const std::string& group_name,
204 ClientSocketHandle* handle) OVERRIDE; 204 ClientSocketHandle* handle) OVERRIDE;
205 205
206 virtual void ReleaseSocket(const std::string& group_name, 206 virtual void ReleaseSocket(const std::string& group_name,
207 StreamSocket* socket, 207 StreamSocket* socket,
208 int id) OVERRIDE; 208 int id) OVERRIDE;
209 209
210 virtual void FlushWithError(int error) OVERRIDE; 210 virtual void FlushWithError(int error) OVERRIDE;
211 211
212 virtual bool IsStalled() const OVERRIDE;
213
214 virtual void CloseIdleSockets() OVERRIDE; 212 virtual void CloseIdleSockets() OVERRIDE;
215 213
216 virtual int IdleSocketCount() const OVERRIDE; 214 virtual int IdleSocketCount() const OVERRIDE;
217 215
218 virtual int IdleSocketCountInGroup( 216 virtual int IdleSocketCountInGroup(
219 const std::string& group_name) const OVERRIDE; 217 const std::string& group_name) const OVERRIDE;
220 218
221 virtual LoadState GetLoadState( 219 virtual LoadState GetLoadState(
222 const std::string& group_name, 220 const std::string& group_name,
223 const ClientSocketHandle* handle) const OVERRIDE; 221 const ClientSocketHandle* handle) const OVERRIDE;
224 222
225 virtual void AddLayeredPool(LayeredPool* layered_pool) OVERRIDE;
226
227 virtual void RemoveLayeredPool(LayeredPool* layered_pool) OVERRIDE;
228
229 virtual base::DictionaryValue* GetInfoAsValue( 223 virtual base::DictionaryValue* GetInfoAsValue(
230 const std::string& name, 224 const std::string& name,
231 const std::string& type, 225 const std::string& type,
232 bool include_nested_pools) const OVERRIDE; 226 bool include_nested_pools) const OVERRIDE;
233 227
234 virtual base::TimeDelta ConnectionTimeout() const OVERRIDE; 228 virtual base::TimeDelta ConnectionTimeout() const OVERRIDE;
235 229
236 virtual ClientSocketPoolHistograms* histograms() const OVERRIDE; 230 virtual ClientSocketPoolHistograms* histograms() const OVERRIDE;
237 231
238 // LayeredPool implementation. 232 // LowerLayeredPool implementation.
233 virtual bool IsStalled() const OVERRIDE;
234
235 virtual void AddHigherLayeredPool(HigherLayeredPool* higher_pool) OVERRIDE;
236
237 virtual void RemoveHigherLayeredPool(HigherLayeredPool* higher_pool) OVERRIDE;
238
239 // HigherLayeredPool implementation.
239 virtual bool CloseOneIdleConnection() OVERRIDE; 240 virtual bool CloseOneIdleConnection() OVERRIDE;
240 241
241 private: 242 private:
242 typedef ClientSocketPoolBase<HttpProxySocketParams> PoolBase; 243 typedef ClientSocketPoolBase<HttpProxySocketParams> PoolBase;
243 244
244 class HttpProxyConnectJobFactory : public PoolBase::ConnectJobFactory { 245 class HttpProxyConnectJobFactory : public PoolBase::ConnectJobFactory {
245 public: 246 public:
246 HttpProxyConnectJobFactory( 247 HttpProxyConnectJobFactory(
247 TransportClientSocketPool* transport_pool, 248 TransportClientSocketPool* transport_pool,
248 SSLClientSocketPool* ssl_pool, 249 SSLClientSocketPool* ssl_pool,
(...skipping 24 matching lines...) Expand all
273 274
274 DISALLOW_COPY_AND_ASSIGN(HttpProxyClientSocketPool); 275 DISALLOW_COPY_AND_ASSIGN(HttpProxyClientSocketPool);
275 }; 276 };
276 277
277 REGISTER_SOCKET_PARAMS_FOR_POOL(HttpProxyClientSocketPool, 278 REGISTER_SOCKET_PARAMS_FOR_POOL(HttpProxyClientSocketPool,
278 HttpProxySocketParams); 279 HttpProxySocketParams);
279 280
280 } // namespace net 281 } // namespace net
281 282
282 #endif // NET_HTTP_HTTP_PROXY_CLIENT_SOCKET_POOL_H_ 283 #endif // NET_HTTP_HTTP_PROXY_CLIENT_SOCKET_POOL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698