Index: base/memory/memory_coordinator_client.h |
diff --git a/base/memory/memory_coordinator_client.h b/base/memory/memory_coordinator_client.h |
index d63b17cc1f8b88779dfaa83b7a677529dbc37573..0a0dc368399bd71e0a614128d686b3fd4cd322dc 100644 |
--- a/base/memory/memory_coordinator_client.h |
+++ b/base/memory/memory_coordinator_client.h |
@@ -5,6 +5,9 @@ |
#ifndef BASE_MEMORY_MEMORY_COORDINATOR_CLIENT_H_ |
#define BASE_MEMORY_MEMORY_COORDINATOR_CLIENT_H_ |
+#include <stdint.h> |
+#include <string> |
+ |
#include "base/base_export.h" |
namespace base { |
@@ -22,7 +25,7 @@ namespace base { |
// MemoryState is an indicator that processes can use to guide their memory |
// allocation policies. For example, a process that receives the suspended |
// state can use that as as signal to drop memory caches. |
-enum class MemoryState { |
+enum class MemoryState : int32_t { |
haraken
2016/11/01 04:20:29
This change wouldn't be needed.
bashi
2016/11/01 05:02:16
Done.
|
// The state is unknown. |
UNKNOWN = -1, |
// No memory constraints. |
@@ -38,6 +41,9 @@ enum class MemoryState { |
SUSPENDED = 2, |
}; |
+// Returns a string representation of MemoryState. |
+BASE_EXPORT std::string MemoryStateToString(MemoryState state); |
dcheng
2016/11/01 04:33:37
If possible, let's return const char* to make this
bashi
2016/11/01 05:02:16
Done.
|
+ |
// This is an interface for components which can respond to memory status |
// changes. An initial state is NORMAL. See MemoryCoordinatorClientRegistry for |
// threading guarantees and ownership management. |