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

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

Issue 2456493003: Add frame-specific InterfaceProviderSpec. (Closed)
Patch Set: . Created 4 years, 2 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 25e537c876ce93264b7084f66f30b260df8a5f92..4a80042e3ac794a912c225f4f8caa96ae9407da8 100644
--- a/services/service_manager/public/cpp/lib/interface_registry.cc
+++ b/services/service_manager/public/cpp/lib/interface_registry.cc
@@ -60,21 +60,18 @@ InterfaceSet GetAllowedInterfaces(
} // namespace
-InterfaceRegistry::InterfaceRegistry(
- const Identity& identity,
- const InterfaceProviderSpec& interface_provider_spec)
- : binding_(this),
- identity_(identity),
- interface_provider_spec_(interface_provider_spec),
- weak_factory_(this) {}
-
+InterfaceRegistry::InterfaceRegistry() : binding_(this), weak_factory_(this) {}
InterfaceRegistry::~InterfaceRegistry() {}
void InterfaceRegistry::Bind(
mojom::InterfaceProviderRequest local_interfaces_request,
+ const Identity& local_identity,
+ const InterfaceProviderSpec& local_interface_provider_spec,
const Identity& remote_identity,
const InterfaceProviderSpec& remote_interface_provider_spec) {
DCHECK(!binding_.is_bound());
+ identity_ = local_identity;
+ interface_provider_spec_ = local_interface_provider_spec;
remote_identity_ = remote_identity;
allowed_interfaces_ = GetAllowedInterfaces(remote_interface_provider_spec,
identity_,
@@ -82,9 +79,11 @@ void InterfaceRegistry::Bind(
allow_all_interfaces_ =
allowed_interfaces_.size() == 1 && allowed_interfaces_.count("*") == 1;
if (!allow_all_interfaces_) {
- for (auto it = name_to_binder_.begin(); it != name_to_binder_.end(); ++it) {
+ for (auto it = name_to_binder_.begin(); it != name_to_binder_.end();) {
if (allowed_interfaces_.count(it->first) == 0)
- name_to_binder_.erase(it);
+ it = name_to_binder_.erase(it);
+ else
+ ++it;
}
}
binding_.Bind(std::move(local_interfaces_request));

Powered by Google App Engine
This is Rietveld 408576698