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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/http/http_network_session.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_network_session.h
diff --git a/net/http/http_network_session.h b/net/http/http_network_session.h
index b4a72ea92f67023a8ebb301a476723f84f7bcde7..688cbdfb0b0c784b4a28c27938526d7518d6609b 100644
--- a/net/http/http_network_session.h
+++ b/net/http/http_network_session.h
@@ -13,6 +13,8 @@
#include <unordered_set>
#include <vector>
+#include "base/bind.h"
+#include "base/memory/memory_pressure_monitor.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/threading/non_thread_safe.h"
@@ -272,6 +274,10 @@ class NET_EXPORT HttpNetworkSession
ClientSocketPoolManager* GetSocketPoolManager(SocketPoolType pool_type);
+ // Flush sockets on low memory notifications callback.
+ void OnMemoryPressure(
+ base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level);
+
NetLog* const net_log_;
HttpServerProperties* const http_server_properties_;
CertVerifier* const cert_verifier_;
@@ -295,6 +301,8 @@ class NET_EXPORT HttpNetworkSession
bool enabled_protocols_[NUM_VALID_ALTERNATE_PROTOCOLS];
Params params_;
+
+ std::unique_ptr<base::MemoryPressureListener> memory_pressure_listener_;
};
} // namespace net
« 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