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

Side by Side Diff: mojo/shell/tests/lifecycle/app_client.cc

Issue 1821913002: Revert of 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: 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 unified diff | Download patch
« no previous file with comments | « mojo/shell/tests/lifecycle/app_client.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "mojo/shell/tests/lifecycle/app_client.h" 5 #include "mojo/shell/tests/lifecycle/app_client.h"
6 6
7 #include "mojo/shell/public/cpp/shell_connection.h" 7 #include "mojo/shell/public/cpp/shell_connection.h"
8 8
9 namespace mojo { 9 namespace mojo {
10 namespace shell { 10 namespace shell {
11 namespace test { 11 namespace test {
12 12
13 AppClient::AppClient() {} 13 AppClient::AppClient() {}
14 AppClient::AppClient(shell::mojom::ShellClientRequest request) 14 AppClient::AppClient(shell::mojom::ShellClientRequest request)
15 : connection_(new ShellConnection(this, std::move(request))) {} 15 : connection_(new ShellConnection(this, std::move(request))) {}
16 AppClient::~AppClient() {} 16 AppClient::~AppClient() {}
17 17
18 bool AppClient::AcceptConnection(mojo::Connection* connection) { 18 bool AppClient::AcceptConnection(mojo::Connection* connection) {
19 connection->AddInterface<LifecycleControl>(this); 19 connection->AddInterface<LifecycleControl>(this);
20 return true; 20 return true;
21 } 21 }
22 22
23 void AppClient::ShellConnectionLost() {
24 GracefulQuit();
25 }
26
23 void AppClient::Create(mojo::Connection* connection, 27 void AppClient::Create(mojo::Connection* connection,
24 LifecycleControlRequest request) { 28 LifecycleControlRequest request) {
25 bindings_.AddBinding(this, std::move(request)); 29 bindings_.AddBinding(this, std::move(request));
26 } 30 }
27 31
28 void AppClient::Ping(const PingCallback& callback) { 32 void AppClient::Ping(const PingCallback& callback) {
29 callback.Run(); 33 callback.Run();
30 } 34 }
31 35
32 void AppClient::GracefulQuit() { 36 void AppClient::GracefulQuit() {
(...skipping 18 matching lines...) Expand all
51 void AppClient::BindingLost() { 55 void AppClient::BindingLost() {
52 if (bindings_.empty()) 56 if (bindings_.empty())
53 GracefulQuit(); 57 GracefulQuit();
54 } 58 }
55 59
56 } // namespace test 60 } // namespace test
57 } // namespace shell 61 } // namespace shell
58 } // namespace mojo 62 } // namespace mojo
59 63
60 64
OLDNEW
« no previous file with comments | « mojo/shell/tests/lifecycle/app_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698