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

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, 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/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..7799742bc9acbc5bdf8731c77da7d88630315047 100644
--- a/mojo/application/public/cpp/lib/application_impl.cc
+++ b/mojo/application/public/cpp/lib/application_impl.cc
@@ -15,16 +15,6 @@
namespace mojo {
-namespace {
-
-void DefaultTerminationClosure() {
- if (base::MessageLoop::current() &&
- base::MessageLoop::current()->is_running())
- base::MessageLoop::current()->Quit();
-}
-
-} // namespace
-
// TODO(beng): upstream this into mojo repo, array.h
template <typename E, typename T>
struct TypeConverter<std::set<E>, Array<T>> {
@@ -39,12 +29,6 @@ struct TypeConverter<std::set<E>, Array<T>> {
};
ApplicationImpl::ApplicationImpl(ApplicationDelegate* delegate,
- InterfaceRequest<Application> request)
- : ApplicationImpl(delegate, request.Pass(),
- base::Bind(&DefaultTerminationClosure)) {
-}
-
-ApplicationImpl::ApplicationImpl(ApplicationDelegate* delegate,
InterfaceRequest<Application> request,
const Closure& termination_closure)
: delegate_(delegate),
@@ -73,7 +57,7 @@ ApplicationImpl::~ApplicationImpl() {
DCHECK(!in_destructor_);
in_destructor_ = true;
ClearConnections();
- app_lifetime_helper_.ApplicationTerminated();
+ app_lifetime_helper_.OnQuit();
}
ApplicationConnection* ApplicationImpl::ConnectToApplication(
@@ -140,7 +124,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 +135,6 @@ void ApplicationImpl::Terminate() {
}
}
-void ApplicationImpl::QuitNow() {
- delegate_->Quit();
- termination_closure_.Run();
-}
-
void ApplicationImpl::AcceptConnection(
const String& requestor_url,
InterfaceRequest<ServiceProvider> services,
@@ -201,4 +180,9 @@ void ApplicationImpl::OnConnectionError() {
shell_ = nullptr;
}
+void ApplicationImpl::QuitNow() {
+ delegate_->Quit();
+ termination_closure_.Run();
+}
+
} // namespace mojo

Powered by Google App Engine
This is Rietveld 408576698