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

Unified Diff: net/sdch/sdch_owner.h

Issue 2390603002: Make SdchOwner a client of memory coordinator (Closed)
Patch Set: Fix comments Created 4 years, 2 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/sdch/sdch_owner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/sdch/sdch_owner.h
diff --git a/net/sdch/sdch_owner.h b/net/sdch/sdch_owner.h
index 48a7db2ec5562b44d5dbbddf82c7732596491179..5ad2e1b913d3c85793be790188fe8586acbc78c3 100644
--- a/net/sdch/sdch_owner.h
+++ b/net/sdch/sdch_owner.h
@@ -12,6 +12,7 @@
#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 "net/base/sdch_observer.h"
@@ -31,7 +32,8 @@ class URLRequestContext;
// exposes interface for setting SDCH policy. It should be instantiated by
// the net/ embedder.
// TODO(rdsmith): Implement dictionary prioritization.
-class NET_EXPORT SdchOwner : public SdchObserver {
+class NET_EXPORT SdchOwner : public SdchObserver,
+ public base::MemoryCoordinatorClient {
public:
// Abstact storage interface for storing settings that allows the embedder
// to provide the appropriate storage backend.
@@ -156,9 +158,15 @@ class NET_EXPORT SdchOwner : public SdchObserver {
DictionaryInfo& operator=(const DictionaryInfo& rhs) = default;
};
+ // base::MemoryCoordinatorClient implementation:
+ void OnMemoryStateChange(base::MemoryState state) override;
+
void OnMemoryPressure(
base::MemoryPressureListener::MemoryPressureLevel level);
+ // Clears data to save memory usage.
+ void ClearData();
+
// Schedule loading of all dictionaries described in |persisted_info|.
// Returns false and does not schedule a load if |persisted_info| has an
// unsupported version or no dictionaries key. Skips any dictionaries that are
« no previous file with comments | « no previous file | net/sdch/sdch_owner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698