| Index: base/memory/low_memory_observer_chromeos.h
|
| diff --git a/base/memory/low_memory_observer_chromeos.h b/base/memory/low_memory_observer_chromeos.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..b873170f02f7266d231be9a1d5677259c30a6e0b
|
| --- /dev/null
|
| +++ b/base/memory/low_memory_observer_chromeos.h
|
| @@ -0,0 +1,36 @@
|
| +// Copyright 2017 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 BASE_MEMORY_LOW_MEMORY_OBSERVER_CHROMEOS_H_
|
| +#define BASE_MEMORY_LOW_MEMORY_OBSERVER_CHROMEOS_H_
|
| +
|
| +#include "base/base_export.h"
|
| +#include "base/files/scoped_file.h"
|
| +
|
| +namespace base {
|
| +namespace chromeos {
|
| +
|
| +// TODO(bashi): Write description of the class.
|
| +class BASE_EXPORT LowMemoryObserver {
|
| + public:
|
| + LowMemoryObserver();
|
| + ~LowMemoryObserver();
|
| +
|
| + // Returns true when the kernel low memory observer is available.
|
| + bool is_valid() const { return low_mem_file_.is_valid(); }
|
| +
|
| + // Checks if the kernel has detected a low memory situation. This will be
|
| + // called less than once a second.
|
| + bool IsLowMemoryCondition() const;
|
| +
|
| + private:
|
| + ScopedFD low_mem_file_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(LowMemoryObserver);
|
| +};
|
| +
|
| +} // namespace chromeos
|
| +} // namespace base
|
| +
|
| +#endif // BASE_MEMORY_LOW_MEMORY_OBSERVER_CHROMEOS_H_
|
|
|