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

Unified Diff: base/memory/memory_coordinator_client.h

Issue 2466773002: memory coordinator: Add trace macros to track state changes (Closed)
Patch Set: comment Created 4 years, 1 month 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
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.

Powered by Google App Engine
This is Rietveld 408576698