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

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

Issue 1165013005: Changes html_viewer to get services from appropriate application (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment on OnTerminate Created 5 years, 6 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/application_impl.h ('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 7de757f0ce6b1690e55fb603af3d71b0c49f1ff8..bafabe276fbc04eb61da9300ebc3412fbd1577e8 100644
--- a/mojo/application/public/cpp/lib/application_impl.cc
+++ b/mojo/application/public/cpp/lib/application_impl.cc
@@ -35,7 +35,8 @@ ApplicationImpl::ApplicationImpl(ApplicationDelegate* delegate,
binding_(this, request.Pass()),
termination_closure_(termination_closure),
app_lifetime_helper_(this),
- quit_requested_(false) {
+ quit_requested_(false),
+ weak_factory_(this) {
}
void ApplicationImpl::ClearConnections() {
@@ -140,7 +141,10 @@ void ApplicationImpl::OnQuitRequested(const Callback<void(bool)>& callback) {
}
void ApplicationImpl::OnConnectionError() {
+ base::WeakPtr<ApplicationImpl> ptr(weak_factory_.GetWeakPtr());
QuitNow();
+ if (!ptr)
+ return;
shell_ = nullptr;
}
« no previous file with comments | « mojo/application/public/cpp/application_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698