Chromium Code Reviews| 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_ |