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

Unified Diff: services/resource_coordinator/coordination_unit/coordination_unit_impl.h

Issue 2848053002: Revert of Global Resource Coordinator: Basic service internals (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: services/resource_coordinator/coordination_unit/coordination_unit_impl.h
diff --git a/services/resource_coordinator/coordination_unit/coordination_unit_impl.h b/services/resource_coordinator/coordination_unit/coordination_unit_impl.h
deleted file mode 100644
index a5c47f5e7710ad7be6598bb27be230a9929a6356..0000000000000000000000000000000000000000
--- a/services/resource_coordinator/coordination_unit/coordination_unit_impl.h
+++ /dev/null
@@ -1,72 +0,0 @@
-// 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.
-
-#ifndef SERVICES_RESOURCE_COORDINATOR_COORDINATION_UNIT_COORDINATION_UNIT_IMPL_H_
-#define SERVICES_RESOURCE_COORDINATOR_COORDINATION_UNIT_COORDINATION_UNIT_IMPL_H_
-
-#include <list>
-
-#include "base/optional.h"
-#include "mojo/public/cpp/bindings/binding_set.h"
-#include "mojo/public/cpp/bindings/interface_request.h"
-#include "mojo/public/cpp/bindings/strong_binding.h"
-#include "services/resource_coordinator/public/cpp/coordination_unit_id.h"
-#include "services/resource_coordinator/public/interfaces/coordination_unit.mojom.h"
-#include "services/resource_coordinator/public/interfaces/coordination_unit_provider.mojom.h"
-#include "services/service_manager/public/cpp/service_context_ref.h"
-
-namespace resource_coordinator {
-
-class CoordinationUnitImpl : public mojom::CoordinationUnit {
- public:
- CoordinationUnitImpl(
- const CoordinationUnitID& id,
- std::unique_ptr<service_manager::ServiceContextRef> service_ref);
- ~CoordinationUnitImpl() override;
-
- // Overridden from mojom::CoordinationUnit:
- void SendEvent(mojom::EventPtr event) override;
- void GetID(const GetIDCallback& callback) override;
- void Duplicate(mojom::CoordinationUnitRequest request) override;
- void AddChild(const CoordinationUnitID& child_id) override;
- void SetCoordinationPolicyCallback(
- mojom::CoordinationPolicyCallbackPtr callback) override;
-
- private:
- bool AddChild(CoordinationUnitImpl* child);
- void RemoveChild(CoordinationUnitImpl* child);
- void AddParent(CoordinationUnitImpl* parent);
- void RemoveParent(CoordinationUnitImpl* parent);
- bool HasParent(CoordinationUnitImpl* unit);
- bool HasChild(CoordinationUnitImpl* unit);
-
- void RecalcCoordinationPolicy();
- void UnregisterCoordinationPolicyCallback();
-
- enum StateFlags : uint8_t {
- kTestState,
- kTabVisible,
- kAudioPlaying,
- kNumStateFlags
- };
- bool SelfOrParentHasFlagSet(StateFlags state);
-
- std::unique_ptr<service_manager::ServiceContextRef> service_ref_;
- mojo::BindingSet<mojom::CoordinationUnit> bindings_;
- CoordinationUnitID id_;
-
- std::set<CoordinationUnitImpl*> children_;
- std::set<CoordinationUnitImpl*> parents_;
-
- mojom::CoordinationPolicyCallbackPtr policy_callback_;
- mojom::CoordinationPolicyPtr current_policy_;
-
- base::Optional<bool> state_flags_[kNumStateFlags];
-
- DISALLOW_COPY_AND_ASSIGN(CoordinationUnitImpl);
-};
-
-} // namespace resource_coordinator
-
-#endif // SERVICES_RESOURCE_COORDINATOR_COORDINATION_UNIT_COORDINATION_UNIT_IMPL_H_
« no previous file with comments | « services/resource_coordinator/DEPS ('k') | services/resource_coordinator/coordination_unit/coordination_unit_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698