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

Side by Side Diff: services/resource_coordinator/public/interfaces/coordination_unit.mojom

Issue 2798713002: Global Resource Coordinator: Basic service internals (Closed)
Patch Set: Wrap EventType directly in resource_coordinator namespace when using helper Created 3 years, 8 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 unified diff | Download patch
OLDNEW
(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
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
10 // coordination_unit.mojom, and have mappings between the two defined in
11 // coordination_unit_struct_traits.h/.cc
12 enum CoordinationUnitType {
13 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.
14 WEBCONTENTS,
15 FRAME,
16 NAVIGATION,
17 PROCESS,
18 };
19
20 struct CoordinationUnitID {
21 CoordinationUnitType type;
22 int32 id;
23 };
24
25 struct Policy {
26 bool use_background_priority;
27 };
28
29 interface PolicyCallback {
30 SetPolicy(Policy policy);
31 };
32
33 interface CoordinationUnit {
34 SendEvent(Event event);
35
36 // Mainly used to force a round-trip to the service over the pipe for
37 // a specific unit, so we don't have to deal with possibly-not-yet-created
38 // children in AddChild()
39 GetID() => (CoordinationUnitID id);
40
41 Duplicate(CoordinationUnit& request);
42 AddChild(CoordinationUnitID child_id);
43 SetPolicyCallback(PolicyCallback callback);
44 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698