Index: mojo/application/public/cpp/lib/application_impl.cc |
diff --git a/mojo/application/public/cpp/lib/application_impl.cc b/mojo/application/public/cpp/lib/application_impl.cc |
index edfeed2f2f55fead1df90395918e4418485a8a8b..f24429bceb61412656c935cb9858abe6d54a3bb6 100644 |
--- a/mojo/application/public/cpp/lib/application_impl.cc |
+++ b/mojo/application/public/cpp/lib/application_impl.cc |
@@ -55,25 +55,11 @@ ApplicationImpl::ApplicationImpl(ApplicationDelegate* delegate, |
in_destructor_(false), |
weak_factory_(this) {} |
-void ApplicationImpl::ClearConnections() { |
- // Copy the ServiceRegistryLists because they will be mutated by |
- // ApplicationConnection::CloseConnection. |
- ServiceRegistryList incoming_service_registries(incoming_service_registries_); |
- for (internal::ServiceRegistry* registry : incoming_service_registries) |
- registry->CloseConnection(); |
- DCHECK(incoming_service_registries_.empty()); |
- |
- ServiceRegistryList outgoing_service_registries(outgoing_service_registries_); |
- for (internal::ServiceRegistry* registry : outgoing_service_registries) |
- registry->CloseConnection(); |
- DCHECK(outgoing_service_registries_.empty()); |
-} |
- |
ApplicationImpl::~ApplicationImpl() { |
DCHECK(!in_destructor_); |
in_destructor_ = true; |
ClearConnections(); |
- app_lifetime_helper_.ApplicationTerminated(); |
+ app_lifetime_helper_.OnQuit(); |
} |
ApplicationConnection* ApplicationImpl::ConnectToApplication( |
@@ -140,7 +126,7 @@ void ApplicationImpl::UnbindConnections( |
shell->Bind(shell_.PassInterface()); |
} |
-void ApplicationImpl::Terminate() { |
+void ApplicationImpl::Quit() { |
// We can't quit immediately, since there could be in-flight requests from the |
// shell. So check with it first. |
if (shell_) { |
@@ -151,11 +137,6 @@ void ApplicationImpl::Terminate() { |
} |
} |
-void ApplicationImpl::QuitNow() { |
- delegate_->Quit(); |
- termination_closure_.Run(); |
-} |
- |
void ApplicationImpl::AcceptConnection( |
const String& requestor_url, |
InterfaceRequest<ServiceProvider> services, |
@@ -201,4 +182,23 @@ void ApplicationImpl::OnConnectionError() { |
shell_ = nullptr; |
} |
+void ApplicationImpl::ClearConnections() { |
+ // Copy the ServiceRegistryLists because they will be mutated by |
+ // ApplicationConnection::CloseConnection. |
+ ServiceRegistryList incoming_service_registries(incoming_service_registries_); |
+ for (internal::ServiceRegistry* registry : incoming_service_registries) |
+ registry->CloseConnection(); |
+ DCHECK(incoming_service_registries_.empty()); |
+ |
+ ServiceRegistryList outgoing_service_registries(outgoing_service_registries_); |
+ for (internal::ServiceRegistry* registry : outgoing_service_registries) |
+ registry->CloseConnection(); |
+ DCHECK(outgoing_service_registries_.empty()); |
+} |
+ |
+void ApplicationImpl::QuitNow() { |
+ delegate_->Quit(); |
+ termination_closure_.Run(); |
+} |
+ |
} // namespace mojo |