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

Unified Diff: services/resource_coordinator/public/cpp/resource_coordinator_interface.h

Issue 2710823003: NOCOMMIT prototype: GRC service plumbing and process priority
Patch Set: Buildfixes Created 3 years, 9 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/cpp/resource_coordinator_interface.h
diff --git a/services/resource_coordinator/public/cpp/resource_coordinator_interface.h b/services/resource_coordinator/public/cpp/resource_coordinator_interface.h
new file mode 100644
index 0000000000000000000000000000000000000000..60828a07fea52998c0f180c0183bb21b31242d6d
--- /dev/null
+++ b/services/resource_coordinator/public/cpp/resource_coordinator_interface.h
@@ -0,0 +1,46 @@
+// 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_PUBLIC_CPP_RESOURCE_COORDINATOR_INTERFACE_H_
+#define SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_RESOURCE_COORDINATOR_INTERFACE_H_
+
+#include <stdint.h>
+
+#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
+#include "services/resource_coordinator/public/interfaces/coordination_unit.mojom.h"
+
+namespace service_manager {
+class Connector;
+}
+
+namespace resource_coordinator {
+
+class ResourceCoordinatorInterface {
+ public:
+ ResourceCoordinatorInterface(service_manager::Connector* connector,
+ const mojom::IDType& type);
+ ~ResourceCoordinatorInterface();
+
+ const mojom::CoordinationUnitPtr& service() const { return service_; }
+
+ void SendEvent(const mojom::EventType& event_type);
+ void AddChild(const ResourceCoordinatorInterface& child);
+
+ private:
+ void ConnectToService(service_manager::Connector* connector,
+ const mojom::IDType& type,
+ const std::string& id);
+ void AddChildByID(
+ resource_coordinator::mojom::CoordinationUnitIDPtr child_id);
+
+ mojom::CoordinationUnitPtr service_;
+ base::WeakPtrFactory<ResourceCoordinatorInterface> weak_ptr_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(ResourceCoordinatorInterface);
+};
+
+} // namespace resource_coordinator
+
+#endif // SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_RESOURCE_COORDINATOR_INTERFACE_H_

Powered by Google App Engine
This is Rietveld 408576698