Chromium Code Reviews| 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..f6b4afe18a7d7bd0ce12e4a9f43ae203c66a9913 100644 |
| --- a/content/browser/dom_storage/dom_storage_context_wrapper.h |
| +++ b/content/browser/dom_storage/dom_storage_context_wrapper.h |
| @@ -11,6 +11,7 @@ |
| #include "base/macros.h" |
| #include "base/memory/memory_pressure_listener.h" |
| #include "base/memory/ref_counted.h" |
| +#include "components/memory_coordinator/common/memory_coordinator_client.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 +38,8 @@ class LevelDBWrapperImpl; |
| // state. |
| class CONTENT_EXPORT DOMStorageContextWrapper : |
| NON_EXPORTED_BASE(public DOMStorageContext), |
| - public base::RefCountedThreadSafe<DOMStorageContextWrapper> { |
| + public base::RefCountedThreadSafe<DOMStorageContextWrapper>, |
| + public memory_coordinator::MemoryCoordinatorClient { |
| public: |
| // If |data_path| is empty, nothing will be saved to disk. |
| DOMStorageContextWrapper( |
| @@ -74,11 +76,14 @@ class CONTENT_EXPORT DOMStorageContextWrapper : |
| mojom::LevelDBObserverPtr observer, |
| mojom::LevelDBWrapperRequest request); |
| + private: |
| // Called on UI thread when the system is under memory pressure. |
| void OnMemoryPressure( |
| base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level); |
| - private: |
| + // memory_coordinator::MemoryCoordinatorClient implementation: |
| + void OnMemoryStateChange(memory_coordinator::MemoryState state) override; |
| + |
| friend class DOMStorageMessageFilter; // for access to context() |
|
michaeln
2016/09/14 19:40:49
nit: it'd be good to keep the two OnMem and PurgeM
hajimehoshi
2016/09/15 09:14:46
Done.
|
| friend class SessionStorageNamespaceImpl; // ditto |
| friend class base::RefCountedThreadSafe<DOMStorageContextWrapper>; |
| @@ -86,6 +91,8 @@ class CONTENT_EXPORT DOMStorageContextWrapper : |
| ~DOMStorageContextWrapper() override; |
| DOMStorageContextImpl* context() const { return context_.get(); } |
| + void PurgeMemory(bool aggressively); |
| + |
| // An inner class to keep all mojo-ish details together and not bleed them |
| // through the public interface. |
| class MojoState; |