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

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

Issue 2798713002: 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_provider_impl.h
diff --git a/services/resource_coordinator/coordination_unit/coordination_unit_provider_impl.h b/services/resource_coordinator/coordination_unit/coordination_unit_provider_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..8f10b3be6078a836194fcdf18adcdcd41f41bf86
--- /dev/null
+++ b/services/resource_coordinator/coordination_unit/coordination_unit_provider_impl.h
@@ -0,0 +1,44 @@
+// 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_PROVIDER_IMPL_H_
+#define SERVICES_RESOURCE_COORDINATOR_COORDINATION_UNIT_COORDINATION_UNIT_PROVIDER_IMPL_H_
+
+#include "mojo/public/cpp/bindings/interface_request.h"
+#include "mojo/public/cpp/bindings/strong_binding.h"
+#include "services/resource_coordinator/public/interfaces/coordination_unit_provider.mojom.h"
+#include "services/service_manager/public/cpp/connection.h"
Primiano Tucci (use gerrit) 2017/04/06 18:09:46 is this include used?
oystein (OOO til 10th of July) 2017/04/10 20:02:59 Leftover; removed.
+#include "services/service_manager/public/cpp/service_context_ref.h"
Primiano Tucci (use gerrit) 2017/04/06 18:09:46 ServiceContextRef could be ust forward declared, r
oystein (OOO til 10th of July) 2017/04/10 20:02:59 Done.
+
+namespace resource_coordinator {
+
+class CoordinationUnitProviderImpl : public mojom::CoordinationUnitProvider {
+ public:
+ CoordinationUnitProviderImpl(
+ service_manager::ServiceContextRefFactory* service_ref_factory);
+ ~CoordinationUnitProviderImpl() override;
+
+ static void Create(
+ service_manager::ServiceContextRefFactory* service_ref_factory,
+ resource_coordinator::mojom::CoordinationUnitProviderRequest request) {
Primiano Tucci (use gerrit) 2017/04/06 18:09:46 why this is inlined? inlining should be only for t
oystein (OOO til 10th of July) 2017/04/10 20:02:59 Copy pasted from elsewhere; no good reason that I
+ mojo::MakeStrongBinding(
+ base::MakeUnique<CoordinationUnitProviderImpl>(service_ref_factory),
+ std::move(request));
+ }
+
+ // Overridden from mojom::CoordinationUnitProvider:
+ void CreateCoordinationUnit(
+ resource_coordinator::mojom::CoordinationUnitRequest request,
+ const CoordinationUnitID& id) override;
+
+ private:
+ service_manager::ServiceContextRefFactory* service_ref_factory_;
+ std::unique_ptr<service_manager::ServiceContextRef> service_ref_;
+
+ DISALLOW_COPY_AND_ASSIGN(CoordinationUnitProviderImpl);
+};
+
+} // namespace resource_coordinator
+
+#endif // SERVICES_RESOURCE_COORDINATOR_COORDINATION_UNIT_COORDINATION_UNIT_PROVIDER_IMPL_H_

Powered by Google App Engine
This is Rietveld 408576698