Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 module memory_coordinator.mojom; | 5 module memory_coordinator.mojom; |
| 6 | 6 |
| 7 enum MemoryState { | 7 enum MemoryState { |
| 8 UNKNOWN = -1, | 8 UNKNOWN = -1, |
| 9 NORMAL = 0, | 9 NORMAL = 0, |
| 10 THROTTLED = 1, | 10 THROTTLED = 1, |
| 11 // TODO(bashi): Define SUSPENDED when we need it. | 11 // TODO(bashi): Define SUSPENDED when we need it. |
| 12 // SUSPENDED = 2, | 12 // SUSPENDED = 2, |
| 13 }; | 13 }; |
| 14 | 14 |
| 15 // ChildMemoryCoordinator lives in a child process and receives memory events | 15 // ChildMemoryCoordinator lives in a child process and receives memory events |
| 16 // dispatched by the central memory coordinator which lives in the browser | 16 // dispatched by the central memory coordinator which lives in the browser |
| 17 // process. | 17 // process. |
| 18 interface ChildMemoryCoordinator { | 18 interface ChildMemoryCoordinator { |
| 19 // Called when the central memory coodinator changes the state for child | 19 // Called when the central memory coodinator changes the state for child |
| 20 // processes. | 20 // processes. |
| 21 OnStateChange(MemoryState state); | 21 OnStateChange(MemoryState state); |
| 22 | |
| 23 // Returns the latest memory state. | |
| 24 GetLastState() => (MemoryState state); | |
|
haraken
2016/06/27 02:17:07
GetLastState => GetCurrentState ?
bashi
2016/06/27 03:49:29
Done.
| |
| 22 }; | 25 }; |
| OLD | NEW |