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

Side by Side Diff: services/resource_coordinator/coordination_unit/coordination_unit_graph_observer.cc

Issue 2926663003: [GRC] Coordination Unit Graph Observer (Closed)
Patch Set: Rebase Created 3 years, 6 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 #include "services/resource_coordinator/coordination_unit/coordination_unit_grap h_observer.h"
6
7 #include "services/resource_coordinator/public/cpp/coordination_unit_types.h"
8
9 namespace resource_coordinator {
10
11 // Setting filter_ to CoordinationUnitType::kInvalidType bypasses the
12 // filtering used to determine whether or not
13 // CoordinationUnitGraphObserver::CoordinationUnitCreated should be invoked
14 // when a new CoordinationUnitImpl is created in the CoordinationUnitManager.
15 CoordinationUnitGraphObserver::CoordinationUnitGraphObserver()
16 : filter_(CoordinationUnitType::kInvalidType) {}
17
18 CoordinationUnitGraphObserver::CoordinationUnitGraphObserver(
19 CoordinationUnitType filter)
20 : filter_(filter) {}
21
22 CoordinationUnitGraphObserver::~CoordinationUnitGraphObserver() = default;
23
24 bool CoordinationUnitGraphObserver::ShouldObserve(
25 CoordinationUnitImpl* coordination_unit) {
26 // CoordinationUnitType::kInvalidType overrides filtering.
27 return filter_ == CoordinationUnitType::kInvalidType ||
28 filter_ == coordination_unit->id().type;
29 }
30
31 } // namespace resource_coordinator
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698