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

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

Issue 1755423002: Add a test for application lifecycle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@27amtest
Patch Set: . Created 4 years, 10 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/public/cpp/application_runner.h ('k') | mojo/shell/tests/BUILD.gn » ('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 de4bfe9639ae47fab8696124f9a3b9bf33c7f975..3a358608c2a5b759f4e4ef65cc52d699fd3623a9 100644
--- a/mojo/shell/public/cpp/lib/application_runner.cc
+++ b/mojo/shell/public/cpp/lib/application_runner.cc
@@ -54,10 +54,10 @@ MojoResult ApplicationRunner::Run(MojoHandle shell_client_request_handle,
else
loop.reset(new base::MessageLoop(message_loop_type_));
- ShellConnection impl(client_.get(),
- MakeRequest<shell::mojom::ShellClient>(
- MakeScopedHandle(MessagePipeHandle(
- shell_client_request_handle))));
+ connection_.reset(new ShellConnection(
+ client_.get(),
+ MakeRequest<shell::mojom::ShellClient>(MakeScopedHandle(
+ MessagePipeHandle(shell_client_request_handle)))));
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
@@ -67,6 +67,7 @@ MojoResult ApplicationRunner::Run(MojoHandle shell_client_request_handle,
// client.
loop.reset();
client_.reset();
+ connection_.reset();
}
return MOJO_RESULT_OK;
}
@@ -80,4 +81,8 @@ MojoResult ApplicationRunner::Run(MojoHandle shell_client_request_handle) {
return Run(shell_client_request_handle, init_base);
}
+void ApplicationRunner::DestroyShellConnection() {
+ connection_.reset();
+}
+
} // namespace mojo
« no previous file with comments | « mojo/shell/public/cpp/application_runner.h ('k') | mojo/shell/tests/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698