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

Unified Diff: net/ssl/ssl_client_session_cache.h

Issue 2131883002: Clear SSLClientSessionCache on low memory notifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased + removed not used method 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/ssl/ssl_client_session_cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/ssl/ssl_client_session_cache.h
diff --git a/net/ssl/ssl_client_session_cache.h b/net/ssl/ssl_client_session_cache.h
index 149d4dc36d0079dfde3cc630ef6efbbdd9ddb212..63990a9a7c8af7ece8b22d3e301ba59db259580f 100644
--- a/net/ssl/ssl_client_session_cache.h
+++ b/net/ssl/ssl_client_session_cache.h
@@ -11,8 +11,10 @@
#include <memory>
#include <string>
+#include "base/bind.h"
#include "base/containers/mru_cache.h"
#include "base/macros.h"
+#include "base/memory/memory_pressure_monitor.h"
#include "base/synchronization/lock.h"
#include "base/threading/thread_checker.h"
#include "base/time/time.h"
@@ -74,6 +76,10 @@ class NET_EXPORT SSLClientSessionCache {
// Removes all expired sessions from the cache.
void FlushExpiredSessions();
+ // Clear cache on low memory notifications callback.
+ void OnMemoryPressure(
+ base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level);
+
std::unique_ptr<base::Clock> clock_;
Config config_;
CacheEntryMap cache_;
@@ -84,6 +90,8 @@ class NET_EXPORT SSLClientSessionCache {
// classes in net.
base::Lock lock_;
+ std::unique_ptr<base::MemoryPressureListener> memory_pressure_listener_;
+
DISALLOW_COPY_AND_ASSIGN(SSLClientSessionCache);
};
« no previous file with comments | « no previous file | net/ssl/ssl_client_session_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698