Index: services/resource_coordinator/public/interfaces/coordination_unit.mojom |
diff --git a/services/resource_coordinator/public/interfaces/coordination_unit.mojom b/services/resource_coordinator/public/interfaces/coordination_unit.mojom |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c6ad443b18634ae8d6113610d0c1500a9719ccb2 |
--- /dev/null |
+++ b/services/resource_coordinator/public/interfaces/coordination_unit.mojom |
@@ -0,0 +1,44 @@ |
+// Copyright 2017 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. |
+ |
+module resource_coordinator.mojom; |
+ |
+import "events.mojom"; |
+ |
+// Any new type here needs to be mirrored between coordination_unit_types.h and |
dcheng
2017/04/18 05:40:46
Out of curiosity, why not use the mojo enum direct
oystein (OOO til 10th of July)
2017/04/18 20:55:33
The idea is that the CUIDs will become more integr
|
+// coordination_unit.mojom, and have mappings between the two defined in |
+// coordination_unit_struct_traits.h/.cc |
+enum CoordinationUnitType { |
+ INVALID_TYPE, |
dcheng
2017/04/18 05:40:47
This doesn't seem to be used. Is it needed?
oystein (OOO til 10th of July)
2017/04/18 20:55:33
Nope really; removed.
|
+ WEBCONTENTS, |
+ FRAME, |
+ NAVIGATION, |
+ PROCESS, |
+}; |
+ |
+struct CoordinationUnitID { |
+ CoordinationUnitType type; |
+ int32 id; |
+}; |
+ |
+struct Policy { |
+ bool use_background_priority; |
+}; |
+ |
+interface PolicyCallback { |
+ SetPolicy(Policy policy); |
+}; |
+ |
+interface CoordinationUnit { |
+ SendEvent(Event event); |
+ |
+ // Mainly used to force a round-trip to the service over the pipe for |
+ // a specific unit, so we don't have to deal with possibly-not-yet-created |
+ // children in AddChild() |
+ GetID() => (CoordinationUnitID id); |
+ |
+ Duplicate(CoordinationUnit& request); |
+ AddChild(CoordinationUnitID child_id); |
+ SetPolicyCallback(PolicyCallback callback); |
+}; |