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

Unified Diff: mojo/application/public/cpp/lib/application_impl.cc

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
« no previous file with comments | « mojo/application/public/cpp/lib/app_lifetime_helper.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « mojo/application/public/cpp/lib/app_lifetime_helper.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698