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

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

Issue 1266643003: ApplicationImpl cleanup, part 1: (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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/application/public/cpp/application_impl.h
diff --git a/mojo/application/public/cpp/application_impl.h b/mojo/application/public/cpp/application_impl.h
index 9c040131f4a1a2c60eb26ccab85120f773a2ff35..1073f70e55f579c4d0868e25cde110c3beaa46ec 100644
--- a/mojo/application/public/cpp/application_impl.h
+++ b/mojo/application/public/cpp/application_impl.h
@@ -19,6 +19,7 @@
namespace mojo {
+// TODO(beng): this comment is hilariously out of date.
// Utility class for communicating with the Shell, and providing Services
// to clients.
//
@@ -56,11 +57,8 @@ class ApplicationImpl : public Application {
public:
// Does not take ownership of |delegate|, which must remain valid for the
// lifetime of ApplicationImpl.
- ApplicationImpl(ApplicationDelegate* delegate,
- InterfaceRequest<Application> request);
- // Constructs an ApplicationImpl with a custom termination closure. This
- // closure is invoked on Terminate() instead of the default behavior of
- // quitting the current MessageLoop.
+ // |termination_closure| is called after the connection with the shell is
+ // broken.
ApplicationImpl(ApplicationDelegate* delegate,
InterfaceRequest<Application> request,
const Closure& termination_closure);
@@ -113,12 +111,9 @@ class ApplicationImpl : public Application {
void UnbindConnections(InterfaceRequest<Application>* application_request,
ShellPtr* shell);
- // Quits the main run loop for this application. It first checks with the
- // shell to ensure there are no outstanding service requests.
- void Terminate();
-
- // Quits without waiting to check with the shell.
- void QuitNow();
+ // Initiate shutdown of this application. This may involve a round trip to the
+ // Shell to ensure there are no inbound service requests.
+ void Quit();
private:
// Application implementation.
@@ -133,6 +128,10 @@ class ApplicationImpl : public Application {
void ClearConnections();
+ // Called from Quit() when there is no Shell connection, or asynchronously
+ // from Quit() once the Shell has OK'ed shutdown.
+ void QuitNow();
+
typedef std::vector<internal::ServiceRegistry*> ServiceRegistryList;
ServiceRegistryList incoming_service_registries_;

Powered by Google App Engine
This is Rietveld 408576698