OLD | NEW |
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 "services/service_manager/tests/lifecycle/app_client.h" | 5 #include "services/service_manager/tests/lifecycle/app_client.h" |
6 | 6 |
7 #include "services/service_manager/public/cpp/interface_registry.h" | 7 #include "services/service_manager/public/cpp/interface_registry.h" |
8 #include "services/service_manager/public/cpp/service_context.h" | 8 #include "services/service_manager/public/cpp/service_context.h" |
9 | 9 |
10 namespace service_manager { | 10 namespace service_manager { |
(...skipping 23 matching lines...) Expand all Loading... |
34 base::MessageLoop::current()->QuitWhenIdle(); | 34 base::MessageLoop::current()->QuitWhenIdle(); |
35 } | 35 } |
36 | 36 |
37 void AppClient::Crash() { | 37 void AppClient::Crash() { |
38 // Rather than actually crash, which causes a bunch of console spray and | 38 // Rather than actually crash, which causes a bunch of console spray and |
39 // maybe UI clutter on some platforms, just exit without shutting anything | 39 // maybe UI clutter on some platforms, just exit without shutting anything |
40 // down properly. | 40 // down properly. |
41 exit(1); | 41 exit(1); |
42 } | 42 } |
43 | 43 |
44 void AppClient::CloseShellConnection() { | 44 void AppClient::CloseServiceManagerConnection() { |
45 DCHECK(runner_); | 45 DCHECK(runner_); |
46 runner_->DestroyServiceContext(); | 46 runner_->DestroyServiceContext(); |
47 // Quit the app once the caller goes away. | 47 // Quit the app once the caller goes away. |
48 bindings_.set_connection_error_handler( | 48 bindings_.set_connection_error_handler( |
49 base::Bind(&AppClient::BindingLost, base::Unretained(this))); | 49 base::Bind(&AppClient::BindingLost, base::Unretained(this))); |
50 } | 50 } |
51 | 51 |
52 void AppClient::BindingLost() { | 52 void AppClient::BindingLost() { |
53 if (bindings_.empty()) | 53 if (bindings_.empty()) |
54 GracefulQuit(); | 54 GracefulQuit(); |
55 } | 55 } |
56 | 56 |
57 } // namespace test | 57 } // namespace test |
58 } // namespace service_manager | 58 } // namespace service_manager |
OLD | NEW |