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 current memory state. | |
24 GetCurrentStateForTesting() => (MemoryState state); | |
dcheng
2016/07/12 05:20:28
I think we shouldn't expose testing interfaces in
bashi
2016/07/12 05:51:46
Maybe I'm wrong but I think we need an IPC to get
dcheng
2016/07/12 06:10:53
Ah, I missed that it's a browser test. I think we
bashi
2016/07/12 06:19:24
I see. Let me think about a workaround. Probably w
bashi
2016/07/12 06:38:01
Done. dcheng@, what do you think about PS#11?
| |
22 }; | 25 }; |
OLD | NEW |