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

Unified Diff: services/service_manager/public/cpp/lib/interface_registry.cc

Issue 2610853013: Perform InterfaceProviderSpec intersection in the ServiceManager (Closed)
Patch Set: . Created 3 years, 11 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/service_manager/public/cpp/lib/interface_registry.cc
diff --git a/services/service_manager/public/cpp/lib/interface_registry.cc b/services/service_manager/public/cpp/lib/interface_registry.cc
index 91314a6e5300915f20fcf8c38f7eee5881e03eac..a903dc366feeef04e143e3b2b9c4b61b13db45c3 100644
--- a/services/service_manager/public/cpp/lib/interface_registry.cc
+++ b/services/service_manager/public/cpp/lib/interface_registry.cc
@@ -13,7 +13,29 @@
namespace service_manager {
namespace {
-// Returns the set of capabilities required from the target.
+void SerializeIdentity(const Identity& identity, std::stringstream* stream) {
+ *stream << identity.name() << "@" << identity.instance() << " run as: "
+ << identity.user_id();
+}
+
+void SerializeSpec(const InterfaceProviderSpec& spec,
+ std::stringstream* stream) {
+ *stream << " Providing:\n";
+ for (const auto& entry : spec.provides) {
+ *stream << " capability: " << entry.first << " containing interfaces:\n";
+ for (const auto& interface_name : entry.second)
+ *stream << " " << interface_name << "\n";
+ }
+ *stream << "\n Requiring:\n";
+ for (const auto& entry : spec.requires) {
+ *stream << " From: " << entry.first << ":\n";
+ for (const auto& capability_name : entry.second)
+ *stream << " " << capability_name << "\n";
+ }
+}
+
+} // namespace
+
CapabilitySet GetRequestedCapabilities(const InterfaceProviderSpec& source_spec,
const Identity& target) {
CapabilitySet capabilities;
@@ -34,8 +56,6 @@ CapabilitySet GetRequestedCapabilities(const InterfaceProviderSpec& source_spec,
return capabilities;
}
-// Generates a single set of interfaces that is the union of all interfaces
-// exposed by the target for the capabilities requested by the source.
InterfaceSet GetInterfacesToExpose(
const InterfaceProviderSpec& source_spec,
const Identity& target,
@@ -58,29 +78,6 @@ InterfaceSet GetInterfacesToExpose(
return exposed_interfaces;
}
-void SerializeIdentity(const Identity& identity, std::stringstream* stream) {
- *stream << identity.name() << "@" << identity.instance() << " run as: "
- << identity.user_id();
-}
-
-void SerializeSpec(const InterfaceProviderSpec& spec,
- std::stringstream* stream) {
- *stream << " Providing:\n";
- for (const auto& entry : spec.provides) {
- *stream << " capability: " << entry.first << " containing interfaces:\n";
- for (const auto& interface_name : entry.second)
- *stream << " " << interface_name << "\n";
- }
- *stream << "\n Requiring:\n";
- for (const auto& entry : spec.requires) {
- *stream << " From: " << entry.first << ":\n";
- for (const auto& capability_name : entry.second)
- *stream << " " << capability_name << "\n";
- }
-}
-
-} // namespace
-
InterfaceRegistry::InterfaceRegistry(const std::string& name)
: binding_(this),
name_(name),
« no previous file with comments | « services/service_manager/public/cpp/interface_registry.h ('k') | services/service_manager/public/cpp/lib/service_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698