| Index: mojo/public/cpp/application/application_impl.h
|
| diff --git a/mojo/public/cpp/application/application_impl.h b/mojo/public/cpp/application/application_impl.h
|
| index 8f7a84295bc079bfc543a3f646b27ba4aa3cffab..64d1be3781fcf734e0b5da9575799443fd4cd6f8 100644
|
| --- a/mojo/public/cpp/application/application_impl.h
|
| +++ b/mojo/public/cpp/application/application_impl.h
|
| @@ -58,7 +58,7 @@ class ApplicationDelegate;
|
| // BarImpl(ApplicationContext* app_context, BarContext* service_context)
|
| // : app_context_(app_context), servicecontext_(context) {}
|
| //
|
| -// Create an ApplicationDele instance that collects any service implementations.
|
| +// Create an ApplicationImpl instance that collects any service implementations.
|
| //
|
| // ApplicationImpl app(service_provider_handle);
|
| // app.AddService<FooImpl>();
|
| @@ -88,10 +88,25 @@ class ApplicationImpl : public InterfaceImpl<Application> {
|
| }
|
|
|
| private:
|
| + class ShellPtrWatcher : public ErrorHandler {
|
| + public:
|
| + explicit ShellPtrWatcher(ApplicationImpl* impl);
|
| + virtual ~ShellPtrWatcher();
|
| + virtual void OnConnectionError() MOJO_OVERRIDE;
|
| + private:
|
| + ApplicationImpl* impl_;
|
| + MOJO_DISALLOW_COPY_AND_ASSIGN(ShellPtrWatcher);
|
| + };
|
| +
|
| friend MojoResult (::MojoMain)(MojoHandle);
|
|
|
| void BindShell(ScopedMessagePipeHandle shell_handle);
|
| void BindShell(MojoHandle shell_handle);
|
| + void ClearConnections();
|
| + void OnShellError() { ClearConnections(); Terminate(); };
|
| +
|
| + // Quits the main run loop for this application.
|
| + void Terminate();
|
|
|
| // Application implementation.
|
| virtual void AcceptConnection(const String& requestor_url,
|
| @@ -102,6 +117,7 @@ class ApplicationImpl : public InterfaceImpl<Application> {
|
| ServiceRegistryList outgoing_service_registries_;
|
| ApplicationDelegate* delegate_;
|
| ShellPtr shell_;
|
| + ShellPtrWatcher shell_watch_;
|
|
|
| MOJO_DISALLOW_COPY_AND_ASSIGN(ApplicationImpl);
|
| };
|
|
|