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

Unified Diff: mojo/public/cpp/application/lib/service_provider_impl.cc

Issue 1975993002: Change InterfaceFactory<I>::Create() to take a ConnectionContext instead of an ApplicationConnectio… (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 7 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: mojo/public/cpp/application/lib/service_provider_impl.cc
diff --git a/mojo/public/cpp/application/lib/service_provider_impl.cc b/mojo/public/cpp/application/lib/service_provider_impl.cc
index e7978b6aa05ef8229a22ac29e468aac3a0712880..70821e54da63739dd9c9bb2d0ed15070fcec07f3 100644
--- a/mojo/public/cpp/application/lib/service_provider_impl.cc
+++ b/mojo/public/cpp/application/lib/service_provider_impl.cc
@@ -14,29 +14,33 @@ ServiceProviderImpl::ServiceProviderImpl()
}
ServiceProviderImpl::ServiceProviderImpl(
+ const ConnectionContext& connection_context,
InterfaceRequest<ServiceProvider> service_provider_request)
- : binding_(this, service_provider_request.Pass()),
+ : connection_context_(connection_context),
+ binding_(this, service_provider_request.Pass()),
fallback_service_provider_(nullptr) {}
ServiceProviderImpl::~ServiceProviderImpl() {}
void ServiceProviderImpl::Bind(
+ const ConnectionContext& connection_context,
InterfaceRequest<ServiceProvider> service_provider_request) {
+ connection_context_ = connection_context;
binding_.Bind(service_provider_request.Pass());
}
void ServiceProviderImpl::Close() {
- if (binding_.is_bound())
+ if (binding_.is_bound()) {
binding_.Close();
+ connection_context_ = ConnectionContext();
+ }
}
void ServiceProviderImpl::ConnectToService(
const String& service_name,
ScopedMessagePipeHandle client_handle) {
- // TODO(beng): perhaps take app connection thru ctor so that we can pass
- // ApplicationConnection through?
bool service_found = service_connector_registry_.ConnectToService(
- nullptr, service_name, &client_handle);
+ connection_context_, service_name, &client_handle);
if (!service_found && fallback_service_provider_) {
fallback_service_provider_->ConnectToService(service_name,
client_handle.Pass());
« no previous file with comments | « mojo/public/cpp/application/lib/service_connector_registry.cc ('k') | mojo/public/cpp/application/lib/service_registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698