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

Unified Diff: base/memory/memory_pressure_listener.h

Issue 816543004: Update from https://crrev.com/308996 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/files/important_file_writer.cc ('k') | base/memory/memory_pressure_listener.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/memory_pressure_listener.h
diff --git a/base/memory/memory_pressure_listener.h b/base/memory/memory_pressure_listener.h
index f586209c5bc47b35c3f4b6e554bb3ed337e8229f..f159fb06f5f124f4d35999f880253898f3d3578c 100644
--- a/base/memory/memory_pressure_listener.h
+++ b/base/memory/memory_pressure_listener.h
@@ -3,12 +3,9 @@
// found in the LICENSE file.
// MemoryPressure provides static APIs for handling memory pressure on
-// platforms that have such signals, such as Android.
+// platforms that have such signals, such as Android and ChromeOS.
// The app will try to discard buffers that aren't deemed essential (individual
// modules will implement their own policy).
-//
-// Refer to memory_pressure_level_list.h for information about what sorts of
-// signals can be sent under what conditions.
#ifndef BASE_MEMORY_PRESSURE_LISTENER_H_
#define BASE_MEMORY_PRESSURE_LISTENER_H_
@@ -26,12 +23,11 @@ namespace base {
// the listener.
// Note that even on the same thread, the callback is not guaranteed to be
// called synchronously within the system memory pressure broadcast.
-// Please see notes on memory_pressure_level_list.h: some levels are absolutely
-// critical, and if not enough memory is returned to the system, it'll
-// potentially kill the app, and then later the app will have to be
+// Please see notes in MemoryPressureLevel enum below: some levels are
+// absolutely critical, and if not enough memory is returned to the system,
+// it'll potentially kill the app, and then later the app will have to be
// cold-started.
//
-//
// Example:
//
// void OnMemoryPressure(MemoryPressureLevel memory_pressure_level) {
@@ -52,6 +48,11 @@ class BASE_EXPORT MemoryPressureListener {
// A Java counterpart will be generated for this enum.
// GENERATED_JAVA_ENUM_PACKAGE: org.chromium.base
enum MemoryPressureLevel {
+ // No problems, there is enough memory to use. This event is not sent via
+ // callback, but the enum is used in other places to find out the current
+ // state of the system.
+ MEMORY_PRESSURE_LEVEL_NONE = -1,
+
// Modules are advised to free buffers that are cheap to re-allocate and not
// immediately needed.
MEMORY_PRESSURE_LEVEL_MODERATE = 0,
« no previous file with comments | « base/files/important_file_writer.cc ('k') | base/memory/memory_pressure_listener.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698