| Index: base/memory/memory_coordinator_client.h
|
| diff --git a/components/memory_coordinator/public/interfaces/child_memory_coordinator.mojom b/base/memory/memory_coordinator_client.h
|
| similarity index 54%
|
| copy from components/memory_coordinator/public/interfaces/child_memory_coordinator.mojom
|
| copy to base/memory/memory_coordinator_client.h
|
| index 0c3e889e589a47360523de644a9e9d618760af01..da7104a8d94395decb299f15e86aa79069ce2e32 100644
|
| --- a/components/memory_coordinator/public/interfaces/child_memory_coordinator.mojom
|
| +++ b/base/memory/memory_coordinator_client.h
|
| @@ -2,12 +2,17 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -module memory_coordinator.mojom;
|
| +#ifndef BASE_MEMORY_MEMORY_COORDINATOR_CLIENT_H_
|
| +#define BASE_MEMORY_MEMORY_COORDINATOR_CLIENT_H_
|
| +
|
| +#include "base/base_export.h"
|
| +
|
| +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 MemoryState {
|
| +enum class MemoryState {
|
| // The state is unknown.
|
| UNKNOWN = -1,
|
| // No memory constraints.
|
| @@ -18,11 +23,16 @@ enum MemoryState {
|
| SUSPENDED = 2,
|
| };
|
|
|
| -// ChildMemoryCoordinator lives in a child process and receives memory events
|
| -// dispatched by the central memory coordinator which lives in the browser
|
| -// process.
|
| -interface ChildMemoryCoordinator {
|
| - // Called when the central memory coodinator changes the state for child
|
| - // processes.
|
| - OnStateChange(MemoryState state);
|
| +// 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_
|
|
|