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

Side by Side Diff: base/memory/low_memory_observer_chromeos.h

Issue 2783613002: WIP: memory coordinator: Check /dev/chromeos-low-mem to determine memory condition
Patch Set: Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « base/BUILD.gn ('k') | base/memory/low_memory_observer_chromeos.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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_
OLDNEW
« no previous file with comments | « base/BUILD.gn ('k') | base/memory/low_memory_observer_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698