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()); |