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

Unified Diff: components/memory_coordinator/browser/memory_monitor_linux.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_linux.h
diff --git a/components/memory_coordinator/browser/memory_monitor_linux.h b/components/memory_coordinator/browser/memory_monitor_linux.h
new file mode 100644
index 0000000000000000000000000000000000000000..eda27791835cc02aa48c8914ef5fc2058b79bf29
--- /dev/null
+++ b/components/memory_coordinator/browser/memory_monitor_linux.h
@@ -0,0 +1,38 @@
+// Copyright (c) 2016 The Chromium Authors. All rights reserved.
+// 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_LINUX_H_
+#define COMPONENTS_MEMORY_COORDINATOR_BROWSER_MEMORY_MONITOR_LINUX_H_
+
+#include "components/memory_coordinator/browser/memory_monitor.h"
+#include "components/memory_coordinator/common/memory_coordinator_export.h"
+
+namespace base {
+struct SystemMemoryInfoKB;
+} // namespace base
+
+namespace memory_coordinator {
+
+// A memory monitor for the Linux platform.
+class MEMORY_COORDINATOR_EXPORT MemoryMonitorLinux : public MemoryMonitor {
+ public:
+ MemoryMonitorLinux(MemoryMonitorDelegate* delegate);
+ ~MemoryMonitorLinux() override {}
+
+ // MemoryMonitor:
+ int GetFreeMemoryUntilCriticalMB() override;
+
+ // Factory function to create an instance of this class.
+ static std::unique_ptr<MemoryMonitorLinux> Create(
+ MemoryMonitorDelegate* delegate);
+
+ private:
+ // The delegate to be used for retrieving system memory information. Used as a
+ // testing seam.
+ MemoryMonitorDelegate* delegate_;
+};
+
+} // namespace memory_coordinator
+
+#endif // COMPONENTS_MEMORY_COORDINATOR_BROWSER_MEMORY_MONITOR_LINUX_H_
« no previous file with comments | « components/memory_coordinator/browser/memory_monitor.cc ('k') | components/memory_coordinator/browser/memory_monitor_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698