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

Unified Diff: components/memory_coordinator/browser/memory_monitor.h

Issue 2310193002: Added MemoryMonitor for Linux (with test) (Closed)
Patch Set: rebased 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
Index: components/memory_coordinator/browser/memory_monitor.h
diff --git a/components/memory_coordinator/browser/memory_monitor.h b/components/memory_coordinator/browser/memory_monitor.h
index 8477cbc6abcef373d8d2eb16ee55e04cf5e79cb9..e70a038eecfbbcbabc09da6a6b0e73f6b73c5f18 100644
--- a/components/memory_coordinator/browser/memory_monitor.h
+++ b/components/memory_coordinator/browser/memory_monitor.h
@@ -10,6 +10,10 @@
#include "base/macros.h"
#include "components/memory_coordinator/common/memory_coordinator_export.h"
+namespace base {
+struct SystemMemoryInfoKB;
+}
+
namespace memory_coordinator {
// A simple class that monitors the amount of free memory available on a system.
@@ -33,6 +37,22 @@ class MEMORY_COORDINATOR_EXPORT MemoryMonitor {
// Factory function for creating a monitor for the current platform.
MEMORY_COORDINATOR_EXPORT std::unique_ptr<MemoryMonitor> CreateMemoryMonitor();
+
+// A class for fetching system information used by a memory monitor. This can
+// be subclassed for testing or if a particular MemoryMonitor implementation
+// needs additional functionality.
+class MEMORY_COORDINATOR_EXPORT MemoryMonitorDelegate {
+ public:
+ MemoryMonitorDelegate() {}
+ virtual ~MemoryMonitorDelegate();
+
+ // Returns system memory information.
+ virtual void GetSystemMemoryInfo(base::SystemMemoryInfoKB* mem_info);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(MemoryMonitorDelegate);
+};
+
} // namespace memory_coordinator
#endif // COMPONENTS_MEMORY_COORDINATOR_BROWSER_MEMORY_MONITOR_H_
« no previous file with comments | « components/memory_coordinator/browser/BUILD.gn ('k') | components/memory_coordinator/browser/memory_monitor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698