| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef BASE_MEMORY_LOW_MEMORY_OBSERVER_CHROMEOS_H_ |
| 6 #define BASE_MEMORY_LOW_MEMORY_OBSERVER_CHROMEOS_H_ |
| 7 |
| 8 #include "base/base_export.h" |
| 9 #include "base/files/scoped_file.h" |
| 10 |
| 11 namespace base { |
| 12 namespace chromeos { |
| 13 |
| 14 // TODO(bashi): Write description of the class. |
| 15 class BASE_EXPORT LowMemoryObserver { |
| 16 public: |
| 17 LowMemoryObserver(); |
| 18 ~LowMemoryObserver(); |
| 19 |
| 20 // Returns true when the kernel low memory observer is available. |
| 21 bool is_valid() const { return low_mem_file_.is_valid(); } |
| 22 |
| 23 // Checks if the kernel has detected a low memory situation. This will be |
| 24 // called less than once a second. |
| 25 bool IsLowMemoryCondition() const; |
| 26 |
| 27 private: |
| 28 ScopedFD low_mem_file_; |
| 29 |
| 30 DISALLOW_COPY_AND_ASSIGN(LowMemoryObserver); |
| 31 }; |
| 32 |
| 33 } // namespace chromeos |
| 34 } // namespace base |
| 35 |
| 36 #endif // BASE_MEMORY_LOW_MEMORY_OBSERVER_CHROMEOS_H_ |
| OLD | NEW |