| 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_BROWSER_MEMORY_MONITOR_H_ | 5 #ifndef CONTENT_BROWSER_MEMORY_BROWSER_MEMORY_MONITOR_H_ |
| 6 #define CONTENT_BROWSER_MEMORY_BROWSER_MEMORY_MONITOR_H_ | 6 #define CONTENT_BROWSER_MEMORY_BROWSER_MEMORY_MONITOR_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 class CONTENT_EXPORT MemoryMonitorDelegate { | 44 class CONTENT_EXPORT MemoryMonitorDelegate { |
| 45 public: | 45 public: |
| 46 static MemoryMonitorDelegate* GetInstance(); | 46 static MemoryMonitorDelegate* GetInstance(); |
| 47 | 47 |
| 48 MemoryMonitorDelegate() {} | 48 MemoryMonitorDelegate() {} |
| 49 virtual ~MemoryMonitorDelegate(); | 49 virtual ~MemoryMonitorDelegate(); |
| 50 | 50 |
| 51 // Returns system memory information. | 51 // Returns system memory information. |
| 52 virtual void GetSystemMemoryInfo(base::SystemMemoryInfoKB* mem_info); | 52 virtual void GetSystemMemoryInfo(base::SystemMemoryInfoKB* mem_info); |
| 53 | 53 |
| 54 // Gets the system memory-pressure information. Returns true if successful |
| 55 // or false otherwise. The meaning of the returned integer is very much |
| 56 // OS specific. |
| 57 virtual bool GetSystemMemoryPressure(int* mem_pressure); |
| 58 |
| 54 private: | 59 private: |
| 55 friend struct base::DefaultSingletonTraits<MemoryMonitorDelegate>; | 60 friend struct base::DefaultSingletonTraits<MemoryMonitorDelegate>; |
| 56 | 61 |
| 57 DISALLOW_COPY_AND_ASSIGN(MemoryMonitorDelegate); | 62 DISALLOW_COPY_AND_ASSIGN(MemoryMonitorDelegate); |
| 58 }; | 63 }; |
| 59 | 64 |
| 60 } // namespace content | 65 } // namespace content |
| 61 | 66 |
| 62 #endif // CONTENT_BROWSER_MEMORY_BROWSER_MEMORY_MONITOR_H_ | 67 #endif // CONTENT_BROWSER_MEMORY_BROWSER_MEMORY_MONITOR_H_ |
| OLD | NEW |