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

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

Issue 2310193002: Added MemoryMonitor for Linux (with test) (Closed)
Patch Set: removed 5% overhead and moved delegate to common code 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..e71d310aee233c4664753e39af61c65144d7ff07 100644
--- a/components/memory_coordinator/browser/memory_monitor.h
+++ b/components/memory_coordinator/browser/memory_monitor.h
@@ -10,8 +10,27 @@
#include "base/macros.h"
#include "components/memory_coordinator/common/memory_coordinator_export.h"
+namespace base {
+struct SystemMemoryInfoKB;
+}
+
namespace memory_coordinator {
+// A class for fetching system information used by a memory monitor. This can
chrisha 2016/09/07 21:25:09 I'd move this to below the MemoryMonitor definitio
bcwhite 2016/09/08 16:36:49 Done.
+// 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);
+};
+
// A simple class that monitors the amount of free memory available on a system.
// This is an interface to facilitate dependency injection for testing.
class MEMORY_COORDINATOR_EXPORT MemoryMonitor {

Powered by Google App Engine
This is Rietveld 408576698