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

Unified Diff: services/resource_coordinator/coordination_unit_provider.cc

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/coordination_unit_provider.cc
diff --git a/services/resource_coordinator/coordination_unit_provider.cc b/services/resource_coordinator/coordination_unit_provider.cc
new file mode 100644
index 0000000000000000000000000000000000000000..fc98f2b2ff80414000559157ff0dd51116ebfe0b
--- /dev/null
+++ b/services/resource_coordinator/coordination_unit_provider.cc
@@ -0,0 +1,32 @@
+// 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.
+
+#include "services/resource_coordinator/coordination_unit_provider.h"
+
+#include "base/logging.h"
+#include "mojo/public/cpp/bindings/strong_binding.h"
+#include "services/resource_coordinator/coordination_unit.h"
+#include "services/service_manager/public/cpp/connection.h"
+
+namespace resource_coordinator {
+
+CoordinationUnitProvider::CoordinationUnitProvider() = default;
+
+CoordinationUnitProvider::~CoordinationUnitProvider() = default;
+
+void CoordinationUnitProvider::CreateCoordinationUnit(
+ mojom::CoordinationUnitRequest request,
+ mojom::CoordinationUnitIDPtr options) {
+ // TODO(oysteine): A strong binding here means the first binding set up
+ // to a CoordinationUnit via CoordinationUnitProvider, i.e. the authoritative
+ // one in terms of setting the context, has to outlive all of the other
+ // connections (as the rest are just duplicated and held within
+ // CoordinationUnit). Make sure this assumption is correct, or refactor into
+ // some kind of refcounted thing.
+ mojo::MakeStrongBinding(
+ base::MakeUnique<CoordinationUnit>(std::move(options)),
+ std::move(request));
+};
+
+} // namespace resource_coordinator

Powered by Google App Engine
This is Rietveld 408576698