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

Unified Diff: services/shell/public/cpp/lib/service_context.cc

Issue 2215133002: Change signature of OnConnect (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cleanup
Patch Set: . Created 4 years, 4 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
« no previous file with comments | « services/shell/public/cpp/lib/service.cc ('k') | services/shell/public/cpp/service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/shell/public/cpp/lib/service_context.cc
diff --git a/services/shell/public/cpp/lib/service_context.cc b/services/shell/public/cpp/lib/service_context.cc
index 3da21a46c4775205eab82f8033c40e568ce6b30e..92ee74fce0622295ff0db39e310390de7ca5efef 100644
--- a/services/shell/public/cpp/lib/service_context.cc
+++ b/services/shell/public/cpp/lib/service_context.cc
@@ -10,7 +10,7 @@
#include "mojo/public/cpp/bindings/interface_ptr.h"
#include "mojo/public/cpp/bindings/interface_request.h"
#include "services/shell/public/cpp/capabilities.h"
-#include "services/shell/public/cpp/lib/connection_impl.h"
+#include "services/shell/public/cpp/interface_registry.h"
#include "services/shell/public/cpp/lib/connector_impl.h"
#include "services/shell/public/cpp/service.h"
@@ -66,22 +66,18 @@ void ServiceContext::OnConnect(
mojom::IdentityPtr source,
mojom::InterfaceProviderRequest interfaces,
mojom::CapabilityRequestPtr allowed_capabilities) {
- std::unique_ptr<internal::ConnectionImpl> connection(
- new internal::ConnectionImpl(source.To<Identity>(),
- allowed_capabilities.To<CapabilityRequest>(),
- Connection::State::CONNECTED));
+ shell::Identity remote_identity = source.To<Identity>();
+ std::unique_ptr<InterfaceRegistry> registry(
+ new InterfaceRegistry(remote_identity,
+ allowed_capabilities.To<CapabilityRequest>()));
+ registry->Bind(std::move(interfaces));
- std::unique_ptr<InterfaceRegistry> exposed_interfaces(
- new InterfaceRegistry(connection.get()));
- exposed_interfaces->Bind(std::move(interfaces));
- connection->SetExposedInterfaces(std::move(exposed_interfaces));
-
- if (!service_->OnConnect(connection.get()))
+ if (!service_->OnConnect(remote_identity, registry.get()))
return;
// TODO(beng): it appears we never prune this list. We should, when the
- // connection's remote service provider pipe breaks.
- incoming_connections_.push_back(std::move(connection));
+ // registry's remote interface provider pipe breaks.
+ incoming_connections_.push_back(std::move(registry));
}
////////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « services/shell/public/cpp/lib/service.cc ('k') | services/shell/public/cpp/service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698