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

Unified Diff: content/browser/dom_storage/dom_storage_context_wrapper.h

Issue 1953703004: Purge browser cache for dom storage in a smarter way (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dom_storage
Patch Set: Fix limit and description for UMA. Created 4 years, 7 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
Index: content/browser/dom_storage/dom_storage_context_wrapper.h
diff --git a/content/browser/dom_storage/dom_storage_context_wrapper.h b/content/browser/dom_storage/dom_storage_context_wrapper.h
index 17796ff8bb56bd80895e57c457fc26108d901169..701324850accb5570bacdd80feabc529dc074dbb 100644
--- a/content/browser/dom_storage/dom_storage_context_wrapper.h
+++ b/content/browser/dom_storage/dom_storage_context_wrapper.h
@@ -9,6 +9,7 @@
#include <string>
#include "base/macros.h"
+#include "base/memory/memory_pressure_listener.h"
#include "base/memory/ref_counted.h"
#include "content/common/content_export.h"
#include "content/common/storage_partition_service.mojom.h"
@@ -73,6 +74,10 @@ class CONTENT_EXPORT DOMStorageContextWrapper :
mojom::LevelDBObserverPtr observer,
mojom::LevelDBWrapperRequest request);
+ // Called on UI thread when the system is under memory pressure.
+ void OnMemoryPressure(
+ base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level);
+
private:
friend class DOMStorageMessageFilter; // for access to context()
friend class SessionStorageNamespaceImpl; // ditto
@@ -86,6 +91,9 @@ class CONTENT_EXPORT DOMStorageContextWrapper :
class MojoState;
std::unique_ptr<MojoState> mojo_state_;
+ // To receive memory pressure signals.
+ std::unique_ptr<base::MemoryPressureListener> memory_pressure_listener_;
+
scoped_refptr<DOMStorageContextImpl> context_;
DISALLOW_IMPLICIT_CONSTRUCTORS(DOMStorageContextWrapper);

Powered by Google App Engine
This is Rietveld 408576698