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

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

Issue 2132313002: [HttpNetworkSession] Flush socket pools on low memory notification. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mmenke's comments and rebasing Created 4 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
« no previous file with comments | « no previous file | net/http/http_network_session.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_NETWORK_SESSION_H_ 5 #ifndef NET_HTTP_HTTP_NETWORK_SESSION_H_
6 #define NET_HTTP_HTTP_NETWORK_SESSION_H_ 6 #define NET_HTTP_HTTP_NETWORK_SESSION_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
11 #include <set> 11 #include <set>
12 #include <string> 12 #include <string>
13 #include <unordered_set> 13 #include <unordered_set>
14 #include <vector> 14 #include <vector>
15 15
16 #include "base/bind.h"
17 #include "base/memory/memory_pressure_monitor.h"
16 #include "base/memory/ref_counted.h" 18 #include "base/memory/ref_counted.h"
17 #include "base/memory/weak_ptr.h" 19 #include "base/memory/weak_ptr.h"
18 #include "base/threading/non_thread_safe.h" 20 #include "base/threading/non_thread_safe.h"
19 #include "net/base/host_port_pair.h" 21 #include "net/base/host_port_pair.h"
20 #include "net/base/net_export.h" 22 #include "net/base/net_export.h"
21 #include "net/dns/host_resolver.h" 23 #include "net/dns/host_resolver.h"
22 #include "net/http/http_auth_cache.h" 24 #include "net/http/http_auth_cache.h"
23 #include "net/http/http_stream_factory.h" 25 #include "net/http/http_stream_factory.h"
24 #include "net/quic/quic_stream_factory.h" 26 #include "net/quic/quic_stream_factory.h"
25 #include "net/socket/next_proto.h" 27 #include "net/socket/next_proto.h"
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 // |request|. 267 // |request|.
266 void GetSSLConfig(const HttpRequestInfo& request, 268 void GetSSLConfig(const HttpRequestInfo& request,
267 SSLConfig* server_config, 269 SSLConfig* server_config,
268 SSLConfig* proxy_config) const; 270 SSLConfig* proxy_config) const;
269 271
270 private: 272 private:
271 friend class HttpNetworkSessionPeer; 273 friend class HttpNetworkSessionPeer;
272 274
273 ClientSocketPoolManager* GetSocketPoolManager(SocketPoolType pool_type); 275 ClientSocketPoolManager* GetSocketPoolManager(SocketPoolType pool_type);
274 276
277 // Flush sockets on low memory notifications callback.
278 void OnMemoryPressure(
279 base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level);
280
275 NetLog* const net_log_; 281 NetLog* const net_log_;
276 HttpServerProperties* const http_server_properties_; 282 HttpServerProperties* const http_server_properties_;
277 CertVerifier* const cert_verifier_; 283 CertVerifier* const cert_verifier_;
278 HttpAuthHandlerFactory* const http_auth_handler_factory_; 284 HttpAuthHandlerFactory* const http_auth_handler_factory_;
279 285
280 // Not const since it's modified by HttpNetworkSessionPeer for testing. 286 // Not const since it's modified by HttpNetworkSessionPeer for testing.
281 ProxyService* proxy_service_; 287 ProxyService* proxy_service_;
282 const scoped_refptr<SSLConfigService> ssl_config_service_; 288 const scoped_refptr<SSLConfigService> ssl_config_service_;
283 289
284 HttpAuthCache http_auth_cache_; 290 HttpAuthCache http_auth_cache_;
285 SSLClientAuthCache ssl_client_auth_cache_; 291 SSLClientAuthCache ssl_client_auth_cache_;
286 std::unique_ptr<ClientSocketPoolManager> normal_socket_pool_manager_; 292 std::unique_ptr<ClientSocketPoolManager> normal_socket_pool_manager_;
287 std::unique_ptr<ClientSocketPoolManager> websocket_socket_pool_manager_; 293 std::unique_ptr<ClientSocketPoolManager> websocket_socket_pool_manager_;
288 QuicStreamFactory quic_stream_factory_; 294 QuicStreamFactory quic_stream_factory_;
289 SpdySessionPool spdy_session_pool_; 295 SpdySessionPool spdy_session_pool_;
290 std::unique_ptr<HttpStreamFactory> http_stream_factory_; 296 std::unique_ptr<HttpStreamFactory> http_stream_factory_;
291 std::unique_ptr<HttpStreamFactory> http_stream_factory_for_websocket_; 297 std::unique_ptr<HttpStreamFactory> http_stream_factory_for_websocket_;
292 std::set<HttpResponseBodyDrainer*> response_drainers_; 298 std::set<HttpResponseBodyDrainer*> response_drainers_;
293 299
294 NextProtoVector next_protos_; 300 NextProtoVector next_protos_;
295 bool enabled_protocols_[NUM_VALID_ALTERNATE_PROTOCOLS]; 301 bool enabled_protocols_[NUM_VALID_ALTERNATE_PROTOCOLS];
296 302
297 Params params_; 303 Params params_;
304
305 std::unique_ptr<base::MemoryPressureListener> memory_pressure_listener_;
298 }; 306 };
299 307
300 } // namespace net 308 } // namespace net
301 309
302 #endif // NET_HTTP_HTTP_NETWORK_SESSION_H_ 310 #endif // NET_HTTP_HTTP_NETWORK_SESSION_H_
OLDNEW
« no previous file with comments | « no previous file | net/http/http_network_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698