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

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

Issue 2335933003: Make DOMStorageContextWrapper a client of memory coordinator (Closed)
Patch Set: Address on ssid's review 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 | content/browser/dom_storage/dom_storage_context_wrapper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 701324850accb5570bacdd80feabc529dc074dbb..d58bdf2743ffa94de32c3b0023e8b93f883a2f8a 100644
--- a/content/browser/dom_storage/dom_storage_context_wrapper.h
+++ b/content/browser/dom_storage/dom_storage_context_wrapper.h
@@ -9,8 +9,10 @@
#include <string>
#include "base/macros.h"
+#include "base/memory/memory_coordinator_client.h"
#include "base/memory/memory_pressure_listener.h"
#include "base/memory/ref_counted.h"
+#include "content/browser/dom_storage/dom_storage_context_impl.h"
#include "content/common/content_export.h"
#include "content/common/storage_partition_service.mojom.h"
#include "content/public/browser/dom_storage_context.h"
@@ -37,7 +39,8 @@ class LevelDBWrapperImpl;
// state.
class CONTENT_EXPORT DOMStorageContextWrapper :
NON_EXPORTED_BASE(public DOMStorageContext),
- public base::RefCountedThreadSafe<DOMStorageContextWrapper> {
+ public base::RefCountedThreadSafe<DOMStorageContextWrapper>,
+ public base::MemoryCoordinatorClient {
public:
// If |data_path| is empty, nothing will be saved to disk.
DOMStorageContextWrapper(
@@ -74,10 +77,6 @@ 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 +85,15 @@ class CONTENT_EXPORT DOMStorageContextWrapper :
~DOMStorageContextWrapper() override;
DOMStorageContextImpl* context() const { return context_.get(); }
+ // Called on UI thread when the system is under memory pressure.
+ void OnMemoryPressure(
+ base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level);
+
+ // base::MemoryCoordinatorClient implementation:
+ void OnMemoryStateChange(base::MemoryState state) override;
+
+ void PurgeMemory(DOMStorageContextImpl::PurgeOption purge_option);
+
// An inner class to keep all mojo-ish details together and not bleed them
// through the public interface.
class MojoState;
« no previous file with comments | « no previous file | content/browser/dom_storage/dom_storage_context_wrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698