OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 module resource_coordinator.mojom; | |
6 | |
7 import "events.mojom"; | |
8 | |
9 // Any new type here needs to be mirrored between coordination_unit_types.h and | |
10 // coordination_unit.mojom, and have mappings between the two defined in | |
11 // coordination_unit_struct_traits.h/.cc | |
nasko
2017/04/21 00:17:32
Add a short note as to why this type is duplicated
oystein (OOO til 10th of July)
2017/04/21 17:57:55
Done.
| |
12 enum CoordinationUnitType { | |
13 WEBCONTENTS, | |
nasko
2017/04/21 00:17:32
nit: Maybe start moving to k-prefixed enum values
oystein (OOO til 10th of July)
2017/04/21 17:57:55
Ah, great. Done. I much prefer the k-prefixed vers
| |
14 FRAME, | |
15 NAVIGATION, | |
16 PROCESS, | |
17 }; | |
18 | |
19 struct CoordinationUnitID { | |
20 CoordinationUnitType type; | |
21 int32 id; | |
nasko
2017/04/21 00:17:32
Would 32bits be good enough for very long lived br
oystein (OOO til 10th of July)
2017/04/21 17:57:55
Probably better to err on the side of safety here,
| |
22 }; | |
23 | |
24 struct Policy { | |
25 bool use_background_priority; | |
26 }; | |
27 | |
28 interface PolicyCallback { | |
29 SetPolicy(Policy policy); | |
30 }; | |
31 | |
32 interface CoordinationUnit { | |
33 SendEvent(Event event); | |
34 | |
35 // Mainly used to force a round-trip to the service over the pipe for | |
36 // a specific unit, so we don't have to deal with possibly-not-yet-created | |
37 // children in AddChild() | |
38 GetID() => (CoordinationUnitID id); | |
Ken Rockot(use gerrit already)
2017/04/18 21:56:54
I guess this is fine for now (a Ping() => () would
| |
39 | |
40 Duplicate(CoordinationUnit& request); | |
41 AddChild(CoordinationUnitID child_id); | |
42 SetPolicyCallback(PolicyCallback callback); | |
43 }; | |
OLD | NEW |