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

Unified Diff: net/ssl/ssl_client_session_cache.h

Issue 2384703002: Make SSLClientSessionCache a client of memory coordinator (Closed)
Patch Set: Created 4 years, 3 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 63990a9a7c8af7ece8b22d3e301ba59db259580f..279561b89f24ea06f12b49675ca9d30b01c0e2d0 100644
--- a/net/ssl/ssl_client_session_cache.h
+++ b/net/ssl/ssl_client_session_cache.h
@@ -14,6 +14,7 @@
#include "base/bind.h"
#include "base/containers/mru_cache.h"
#include "base/macros.h"
+#include "base/memory/memory_coordinator_client.h"
#include "base/memory/memory_pressure_monitor.h"
#include "base/synchronization/lock.h"
#include "base/threading/thread_checker.h"
@@ -27,7 +28,7 @@ class Clock;
namespace net {
-class NET_EXPORT SSLClientSessionCache {
+class NET_EXPORT SSLClientSessionCache : public base::MemoryCoordinatorClient {
public:
struct Config {
// The maximum number of entries in the cache.
@@ -39,7 +40,7 @@ class NET_EXPORT SSLClientSessionCache {
};
explicit SSLClientSessionCache(const Config& config);
- ~SSLClientSessionCache();
+ ~SSLClientSessionCache() override;
size_t size() const;
@@ -70,6 +71,9 @@ class NET_EXPORT SSLClientSessionCache {
using CacheEntryMap =
base::HashingMRUCache<std::string, std::unique_ptr<CacheEntry>>;
+ // base::MemoryCoordinatorClient implementation:
+ void OnMemoryStateChange(base::MemoryState state) override;
+
// Returns true if |entry| is expired as of |now|.
bool IsExpired(CacheEntry* entry, const base::Time& now);
« 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