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

Unified Diff: components/memory_coordinator/browser/memory_monitor_win.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_win.h
diff --git a/components/memory_coordinator/browser/memory_monitor_win.h b/components/memory_coordinator/browser/memory_monitor_win.h
index 0f621160661b184c3e57eb781a037f01176cbc89..a7ddaa17569d5ee0af30c09d3f1426c82539121b 100644
--- a/components/memory_coordinator/browser/memory_monitor_win.h
+++ b/components/memory_coordinator/browser/memory_monitor_win.h
@@ -14,8 +14,6 @@ struct SystemMemoryInfoKB;
namespace memory_coordinator {
-class MemoryMonitorWinDelegate;
-
// A memory monitor for the Windows platform. After much experimentation this
// class uses a very simple heuristic to anticipate paging (critical memory
// pressure). When the amount of memory available dips below a provided
@@ -28,7 +26,7 @@ class MEMORY_COORDINATOR_EXPORT MemoryMonitorWin : public MemoryMonitor {
static const int kSmallMemoryTargetFreeMB;
static const int kLargeMemoryTargetFreeMB;
- MemoryMonitorWin(MemoryMonitorWinDelegate* delegate, int target_free_mb);
+ MemoryMonitorWin(MemoryMonitorDelegate* delegate, int target_free_mb);
~MemoryMonitorWin() override {}
// MemoryMonitor:
@@ -40,21 +38,21 @@ class MEMORY_COORDINATOR_EXPORT MemoryMonitorWin : public MemoryMonitor {
// Factory function. Automatically sizes |target_free_mb| based on the
// system.
static std::unique_ptr<MemoryMonitorWin> Create(
- MemoryMonitorWinDelegate* delegate);
+ MemoryMonitorDelegate* delegate);
protected:
// Determines if the system is in large memory mode. Exposed so that this
// function can be tested.
- static bool IsLargeMemory(MemoryMonitorWinDelegate* delegate);
+ static bool IsLargeMemory(MemoryMonitorDelegate* delegate);
// Determines the default target free MB value. Exposed so that this function
// can be tested.
- static int GetTargetFreeMB(MemoryMonitorWinDelegate* delegate);
+ static int GetTargetFreeMB(MemoryMonitorDelegate* delegate);
private:
// The delegate to be used for retrieving system memory information. Used as a
// testing seam.
- MemoryMonitorWinDelegate* delegate_;
+ MemoryMonitorDelegate* delegate_;
// The amount of memory that the memory manager (MM) attempts to keep in a
// free state. When less than this amount of physical memory is free, it is
@@ -62,20 +60,6 @@ class MEMORY_COORDINATOR_EXPORT MemoryMonitorWin : public MemoryMonitor {
int target_free_mb_;
};
-// A delegate that wraps functions used by MemoryMonitorWin. Used as a testing
-// seam.
-class MEMORY_COORDINATOR_EXPORT MemoryMonitorWinDelegate {
- public:
- MemoryMonitorWinDelegate() {}
- virtual ~MemoryMonitorWinDelegate() {}
-
- // Returns system memory information.
- virtual void GetSystemMemoryInfo(base::SystemMemoryInfoKB* mem_info) = 0;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(MemoryMonitorWinDelegate);
-};
-
} // namespace memory_coordinator
#endif // COMPONENTS_MEMORY_COORDINATOR_BROWSER_MEMORY_MONITOR_WIN_H_

Powered by Google App Engine
This is Rietveld 408576698