| Index: services/service_manager/public/cpp/lib/service_context.cc
|
| diff --git a/services/service_manager/public/cpp/lib/service_context.cc b/services/service_manager/public/cpp/lib/service_context.cc
|
| index f45202e56b2324dd81f75d51d817a88c810a7fff..2158befed4e8a312149d7be76b046f7a6b51e03e 100644
|
| --- a/services/service_manager/public/cpp/lib/service_context.cc
|
| +++ b/services/service_manager/public/cpp/lib/service_context.cc
|
| @@ -80,6 +80,7 @@ void ServiceContext::DestroyService() {
|
|
|
| void ServiceContext::OnStart(const ServiceInfo& info,
|
| const OnStartCallback& callback) {
|
| + service_started_ = true;
|
| local_info_ = info;
|
| callback.Run(std::move(pending_connector_request_),
|
| mojo::MakeRequest(&service_control_));
|
| @@ -140,6 +141,13 @@ void ServiceContext::CallOnConnect(const ServiceInfo& source_info,
|
| }
|
|
|
| void ServiceContext::OnConnectionError() {
|
| + if (!service_started_) {
|
| + // The pipe was broken before we even received OnStart().
|
| + service_->set_context(this);
|
| + service_->OnStartFailed();
|
| + return;
|
| + }
|
| +
|
| // Note that the Service doesn't technically have to quit now, it may live
|
| // on to service existing connections. All existing Connectors however are
|
| // invalid.
|
|
|