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

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, 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
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..5d2eb45f64b5ae66a46a7c4b591db70b39835ff6 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.
//
@@ -59,8 +60,8 @@ class ApplicationImpl : public Application {
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.
+ // closure is invoked on Quit() instead of the default behavior of quitting
+ // the current base::MessageLoop.
ApplicationImpl(ApplicationDelegate* delegate,
InterfaceRequest<Application> request,
const Closure& termination_closure);
@@ -113,12 +114,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 +131,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_;
« no previous file with comments | « mojo/application/public/cpp/app_lifetime_helper.h ('k') | mojo/application/public/cpp/lib/app_lifetime_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698