Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(397)

Unified Diff: services/resource_coordinator/public/interfaces/coordination_unit.mojom

Issue 2798713002: Global Resource Coordinator: Basic service internals (Closed)
Patch Set: Buildfix after rebase Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..c8c35aacbc9426abc215057370d895e4e8c9712a
--- /dev/null
+++ b/services/resource_coordinator/public/interfaces/coordination_unit.mojom
@@ -0,0 +1,45 @@
+// 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 (see comment in coordination_unit_id.h).
+enum CoordinationUnitType {
+ kWebContents,
+ kFrame,
+ kNavigation,
+ kProcess,
+};
+
+struct CoordinationUnitID {
+ CoordinationUnitType type;
+ int64 id;
+};
+
+struct CoordinationPolicy {
+ bool use_background_priority;
+};
+
+interface CoordinationPolicyCallback {
+ SetCoordinationPolicy(CoordinationPolicy 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);
+ // child_id must represent a CU which already exists service-side,
+ // and can't be a direct ascendent or descendent of the current unit.
+ AddChild(CoordinationUnitID child_id);
+ SetCoordinationPolicyCallback(CoordinationPolicyCallback callback);
+};

Powered by Google App Engine
This is Rietveld 408576698