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

Unified Diff: mojo/public/cpp/application/application_impl.h

Issue 394903005: mojo: terminate apps if the shell goes away (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: disable tests that touch nss for now Created 6 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 | « mojo/public/cpp/application/DEPS ('k') | mojo/public/cpp/application/lib/application_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 37a95fb6c6a12bbe89c3525a8188967db8fa8b6a..2a1a5969bfad2995f781bf5a980237182b4e4032 100644
--- a/mojo/public/cpp/application/application_impl.h
+++ b/mojo/public/cpp/application/application_impl.h
@@ -59,7 +59,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>();
@@ -89,10 +89,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,
@@ -103,6 +118,7 @@ class ApplicationImpl : public InterfaceImpl<Application> {
ServiceRegistryList outgoing_service_registries_;
ApplicationDelegate* delegate_;
ShellPtr shell_;
+ ShellPtrWatcher shell_watch_;
MOJO_DISALLOW_COPY_AND_ASSIGN(ApplicationImpl);
};
« no previous file with comments | « mojo/public/cpp/application/DEPS ('k') | mojo/public/cpp/application/lib/application_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698