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

Unified Diff: base/memory/memory_coordinator_client.h

Issue 2311723002: Move memory_coordinator_client and its registry to base/memory (Closed)
Patch Set: comment 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
« no previous file with comments | « base/BUILD.gn ('k') | base/memory/memory_coordinator_client_registry.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..5d820d36c4b2bcf2d6cfd96a7d01323eb3945866
--- /dev/null
+++ b/base/memory/memory_coordinator_client.h
@@ -0,0 +1,36 @@
+// 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 {
+
+// MemoryState represents status of a process.
dcheng 2016/09/15 00:19:19 Btw, not sure if you want to update these comments
bashi 2016/09/15 00:28:13 Yeah, I'll update the comments to refer .mojom
bashi 2016/09/15 00:39:39 Moved comments from components/memory_coordinator/
+enum class MemoryState {
+ // The state is unknown.
+ UNKNOWN = -1,
+ // Not encountering memory constrains.
+ NORMAL = 0,
+ // Running and interactive but allocations may be limited.
+ THROTTLED = 1,
+ // Still in resident memory but its core processing logic has been suspended.
+ 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_
« no previous file with comments | « base/BUILD.gn ('k') | base/memory/memory_coordinator_client_registry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698