Index: content/browser/dom_storage/dom_storage_context_impl.h |
diff --git a/content/browser/dom_storage/dom_storage_context_impl.h b/content/browser/dom_storage/dom_storage_context_impl.h |
index c2bbe4d42b50fcd2991e976540e64a6e1b58acc0..ad8e5d71adebb370b65dc08fcb1944ede8805dcb 100644 |
--- a/content/browser/dom_storage/dom_storage_context_impl.h |
+++ b/content/browser/dom_storage/dom_storage_context_impl.h |
@@ -15,6 +15,7 @@ |
#include "base/atomic_sequence_num.h" |
#include "base/files/file_path.h" |
#include "base/gtest_prod_util.h" |
+#include "base/memory/memory_pressure_listener.h" |
#include "base/memory/ref_counted.h" |
#include "base/observer_list.h" |
#include "base/time/time.h" |
@@ -175,11 +176,16 @@ class CONTENT_EXPORT DOMStorageContextImpl |
// unclean exit. |
void StartScavengingUnusedSessionStorage(); |
+ // Called on the |task_runner| to purge memory in case of memory pressure. |
+ void PurgeMemory( |
+ base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level); |
+ |
// base::trace_event::MemoryDumpProvider implementation. |
bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args, |
base::trace_event::ProcessMemoryDump* pmd) override; |
private: |
+ class DOMStorageMemoryPressureListener; |
friend class DOMStorageContextImplTest; |
FRIEND_TEST_ALL_PREFIXES(DOMStorageContextImplTest, Basics); |
friend class base::RefCountedThreadSafe<DOMStorageContextImpl>; |
@@ -238,6 +244,9 @@ class CONTENT_EXPORT DOMStorageContextImpl |
// Mapping between persistent namespace IDs and namespace IDs for |
// sessionStorage. |
std::map<std::string, int64_t> persistent_namespace_id_to_namespace_id_; |
+ |
+ // Notifier for memory pressure signals to purges memory. |
+ DOMStorageMemoryPressureListener* leaked_memory_pressure_listener_; |
}; |
} // namespace content |