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

Unified Diff: mojo/shell/public/cpp/lib/application_runner.cc

Issue 1819063002: Quit the message loop by default in ShellConnectionLost when ApplicationRunner is used (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge and update resourceproviderunittest Created 4 years, 9 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/shell/background/tests/test_service.cc ('k') | mojo/shell/public/cpp/lib/shell_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/public/cpp/lib/application_runner.cc
diff --git a/mojo/shell/public/cpp/lib/application_runner.cc b/mojo/shell/public/cpp/lib/application_runner.cc
index 5253053d43f55ebe113404b038976858ab1abffc..201aa62da40e866be03be013d1dd9ea2e4886812 100644
--- a/mojo/shell/public/cpp/lib/application_runner.cc
+++ b/mojo/shell/public/cpp/lib/application_runner.cc
@@ -5,10 +5,12 @@
#include "mojo/shell/public/cpp/application_runner.h"
#include "base/at_exit.h"
+#include "base/bind.h"
#include "base/command_line.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop.h"
#include "base/process/launch.h"
+#include "base/run_loop.h"
#include "mojo/shell/public/cpp/shell_client.h"
#include "mojo/shell/public/cpp/shell_connection.h"
@@ -54,7 +56,9 @@ MojoResult ApplicationRunner::Run(MojoHandle shell_client_request_handle,
client_.get(),
MakeRequest<shell::mojom::ShellClient>(MakeScopedHandle(
MessagePipeHandle(shell_client_request_handle)))));
- loop->Run();
+ base::RunLoop run_loop;
+ connection_->set_connection_lost_closure(run_loop.QuitClosure());
+ run_loop.Run();
// It's very common for the client to cache the app and terminate on errors.
// If we don't delete the client before the app we run the risk of the
// client having a stale reference to the app and trying to use it.
« no previous file with comments | « mojo/shell/background/tests/test_service.cc ('k') | mojo/shell/public/cpp/lib/shell_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698