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

Unified Diff: mojo/application/run_application.cc

Issue 2015363003: Yet more ApplicationDelegate -> ApplicationImplBase conversion. (Closed) Base URL: https://github.com/domokit/mojo.git@work797-x-work796_no_run_main_app
Patch Set: rebased again Created 4 years, 7 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 | « examples/trace_me/trace_me_app.cc ('k') | services/debugger/debugger.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/application/run_application.cc
diff --git a/mojo/application/run_application.cc b/mojo/application/run_application.cc
index ea067d4ae42380c421120548feed8e63b301519c..9f84b9efdbcee9d4182b4f805d7a11202fca655b 100644
--- a/mojo/application/run_application.cc
+++ b/mojo/application/run_application.cc
@@ -10,6 +10,7 @@
#include "base/command_line.h"
#include "base/debug/stack_trace.h"
#include "base/lazy_instance.h"
+#include "base/logging.h"
#include "base/message_loop/message_loop.h"
#include "base/threading/thread_local.h"
#include "build/build_config.h"
@@ -73,7 +74,15 @@ MojoResult RunApplication(MojoHandle application_request_handle,
}
void TerminateApplication(MojoResult result) {
- DCHECK(base::MessageLoop::current()->is_running());
+ // TODO(vtl): Rather than asserting |...->is_running()|, just assert that we
+ // have one, since we may be called during message loop teardown. (The
+ // HandleWatcher is notified of the message loop's pending destruction, and
+ // triggers connection errors.) I should think about this some more.
+ DCHECK(base::MessageLoop::current());
+ if (!base::MessageLoop::current()->is_running()) {
+ DLOG(WARNING) << "TerminateApplication() with message loop not running";
+ return;
+ }
base::MessageLoop::current()->Quit();
ResultHolder* result_holder = g_current_result_holder.Pointer()->Get();
« no previous file with comments | « examples/trace_me/trace_me_app.cc ('k') | services/debugger/debugger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698