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

Unified Diff: content/browser/memory/memory_monitor_win.h

Issue 2321313002: Move components/memory_coordinator -> content/ (Closed)
Patch Set: rebase etc 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: content/browser/memory/memory_monitor_win.h
diff --git a/components/memory_coordinator/browser/memory_monitor_win.h b/content/browser/memory/memory_monitor_win.h
similarity index 72%
rename from components/memory_coordinator/browser/memory_monitor_win.h
rename to content/browser/memory/memory_monitor_win.h
index a7ddaa17569d5ee0af30c09d3f1426c82539121b..bb2d1212fa5f01a1c348ed973a42420d0e2e3c06 100644
--- a/components/memory_coordinator/browser/memory_monitor_win.h
+++ b/content/browser/memory/memory_monitor_win.h
@@ -2,23 +2,22 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef COMPONENTS_MEMORY_COORDINATOR_BROWSER_MEMORY_MONITOR_WIN_H_
-#define COMPONENTS_MEMORY_COORDINATOR_BROWSER_MEMORY_MONITOR_WIN_H_
+#ifndef CONTENT_BROWSER_MEMORY_BROWSER_MEMORY_MONITOR_WIN_H_
+#define CONTENT_BROWSER_MEMORY_BROWSER_MEMORY_MONITOR_WIN_H_
-#include "components/memory_coordinator/browser/memory_monitor.h"
-#include "components/memory_coordinator/common/memory_coordinator_export.h"
+#include "content/browser/memory/memory_monitor.h"
namespace base {
struct SystemMemoryInfoKB;
} // namespace base
-namespace memory_coordinator {
+namespace content {
// 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
// threshold, it is assumed that paging is inevitable.
-class MEMORY_COORDINATOR_EXPORT MemoryMonitorWin : public MemoryMonitor {
+class CONTENT_EXPORT MemoryMonitorWin : public MemoryMonitor {
public:
// Default constants governing the amount of free memory that the memory
// manager attempts to maintain.
@@ -60,6 +59,20 @@ class MEMORY_COORDINATOR_EXPORT MemoryMonitorWin : public MemoryMonitor {
int target_free_mb_;
};
-} // namespace memory_coordinator
+// A delegate that wraps functions used by MemoryMonitorWin. Used as a testing
+// seam.
+class CONTENT_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 content
-#endif // COMPONENTS_MEMORY_COORDINATOR_BROWSER_MEMORY_MONITOR_WIN_H_
+#endif // CONTENT_BROWSER_MEMORY_BROWSER_MEMORY_MONITOR_WIN_H_

Powered by Google App Engine
This is Rietveld 408576698