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

Unified Diff: base/memory/memory_coordinator_client.h

Issue 2311723002: Move memory_coordinator_client and its registry to base/memory (Closed)
Patch Set: Merge TrimMemory with OnMemoryPressure Created 4 years, 3 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 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
new file mode 100644
index 0000000000000000000000000000000000000000..eac223aaae5a2557ddb9a0f77d918a0a3ec161f4
--- /dev/null
+++ b/base/memory/memory_coordinator_client.h
@@ -0,0 +1,31 @@
+// Copyright 2016 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_MEMORY_COORDINATOR_CLIENT_H_
+#define BASE_MEMORY_MEMORY_COORDINATOR_CLIENT_H_
+
+#include "base/base_export.h"
+
+namespace base {
+
+enum class MemoryState {
+ UNKNOWN = -1,
+ NORMAL = 0,
+ THROTTLED = 1,
dcheng 2016/09/09 03:02:04 Please add some comments to these enums (I'm not s
bashi 2016/09/09 03:21:43 Done.
+ SUSPENDED = 2,
+};
+
+// This is an interface for components which can respond to memory status
+// changes.
+class BASE_EXPORT MemoryCoordinatorClient {
+ public:
+ virtual ~MemoryCoordinatorClient() {}
+
+ // Called when memory state has changed.
+ virtual void OnMemoryStateChange(MemoryState state) = 0;
+};
+
+} // namespace base
+
+#endif // BASE_MEMORY_MEMORY_COORDINATOR_CLIENT_H_

Powered by Google App Engine
This is Rietveld 408576698