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..9344459c300b3e77588f867dd75659836b30b8cd |
--- /dev/null |
+++ b/services/resource_coordinator/public/interfaces/coordination_unit.mojom |
@@ -0,0 +1,43 @@ |
+// 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 |
+// coordination_unit.mojom, and have mappings between the two defined in |
+// 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.
|
+enum CoordinationUnitType { |
+ 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
|
+ FRAME, |
+ NAVIGATION, |
+ PROCESS, |
+}; |
+ |
+struct CoordinationUnitID { |
+ CoordinationUnitType type; |
+ 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,
|
+}; |
+ |
+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); |
Ken Rockot(use gerrit already)
2017/04/18 21:56:54
I guess this is fine for now (a Ping() => () would
|
+ |
+ Duplicate(CoordinationUnit& request); |
+ AddChild(CoordinationUnitID child_id); |
+ SetPolicyCallback(PolicyCallback callback); |
+}; |