OLD | NEW |
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_BROWSER_MEMORY_MEMORY_MONITOR_LINUX_H_ | 5 #ifndef CONTENT_BROWSER_MEMORY_MEMORY_MONITOR_CHROMEOS_H_ |
6 #define CONTENT_BROWSER_MEMORY_MEMORY_MONITOR_LINUX_H_ | 6 #define CONTENT_BROWSER_MEMORY_MEMORY_MONITOR_CHROMEOS_H_ |
7 | 7 |
8 #include "content/browser/memory/memory_monitor.h" | 8 #include "content/browser/memory/memory_monitor.h" |
9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
10 | 10 |
11 namespace base { | |
12 struct SystemMemoryInfoKB; | |
13 } // namespace base | |
14 | |
15 namespace content { | 11 namespace content { |
16 | 12 |
17 // A memory monitor for the Linux platform. | 13 // A memory monitor for the ChromeOS platform. |
18 class CONTENT_EXPORT MemoryMonitorLinux : public MemoryMonitor { | 14 class CONTENT_EXPORT MemoryMonitorChromeOS : public MemoryMonitor { |
19 public: | 15 public: |
20 MemoryMonitorLinux(MemoryMonitorDelegate* delegate); | 16 MemoryMonitorChromeOS(MemoryMonitorDelegate* delegate); |
21 ~MemoryMonitorLinux() override; | 17 ~MemoryMonitorChromeOS() override; |
22 | 18 |
23 // MemoryMonitor: | 19 // MemoryMonitor: |
24 int GetFreeMemoryUntilCriticalMB() override; | 20 int GetFreeMemoryUntilCriticalMB() override; |
25 | 21 |
26 // Factory function to create an instance of this class. | 22 // Factory function to create an instance of this class. |
27 static std::unique_ptr<MemoryMonitorLinux> Create( | 23 static std::unique_ptr<MemoryMonitorChromeOS> Create( |
28 MemoryMonitorDelegate* delegate); | 24 MemoryMonitorDelegate* delegate); |
29 | 25 |
30 private: | 26 private: |
31 // The delegate to be used for retrieving system memory information. Used as a | 27 // The delegate to be used for retrieving system memory information. Used as a |
32 // testing seam. | 28 // testing seam. |
33 MemoryMonitorDelegate* delegate_; | 29 MemoryMonitorDelegate* delegate_; |
34 }; | 30 }; |
35 | 31 |
36 } // namespace content | 32 } // namespace content |
37 | 33 |
38 #endif // CONTENT_BROWSER_MEMORY_MEMORY_MONITOR_LINUX_H_ | 34 #endif // CONTENT_BROWSER_MEMORY_MEMORY_MONITOR_CHROMEOS_H_ |
OLD | NEW |