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 <algorithm> | 5 #include <algorithm> |
6 #include <memory> | 6 #include <memory> |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "mojo/public/c/system/main.h" | |
11 #include "mojo/public/cpp/bindings/binding_set.h" | 10 #include "mojo/public/cpp/bindings/binding_set.h" |
| 11 #include "services/shell/public/c/main.h" |
12 #include "services/shell/public/cpp/service_context.h" | 12 #include "services/shell/public/cpp/service_context.h" |
13 #include "services/shell/public/cpp/service_runner.h" | 13 #include "services/shell/public/cpp/service_runner.h" |
14 #include "services/shell/public/interfaces/service_factory.mojom.h" | 14 #include "services/shell/public/interfaces/service_factory.mojom.h" |
15 #include "services/shell/tests/lifecycle/app_client.h" | 15 #include "services/shell/tests/lifecycle/app_client.h" |
16 #include "services/shell/tests/lifecycle/lifecycle_unittest.mojom.h" | 16 #include "services/shell/tests/lifecycle/lifecycle_unittest.mojom.h" |
17 | 17 |
18 namespace { | 18 namespace { |
19 | 19 |
20 class PackagedApp : public shell::Service, | 20 class PackagedApp : public shell::Service, |
21 public shell::InterfaceFactory<LifecycleControl>, | 21 public shell::InterfaceFactory<LifecycleControl>, |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 shell::test::AppClient app_client_; | 138 shell::test::AppClient app_client_; |
139 int shell_connection_refcount_ = 0; | 139 int shell_connection_refcount_ = 0; |
140 mojo::BindingSet<shell::mojom::ServiceFactory> bindings_; | 140 mojo::BindingSet<shell::mojom::ServiceFactory> bindings_; |
141 std::vector<PackagedApp*> apps_; | 141 std::vector<PackagedApp*> apps_; |
142 | 142 |
143 DISALLOW_COPY_AND_ASSIGN(Package); | 143 DISALLOW_COPY_AND_ASSIGN(Package); |
144 }; | 144 }; |
145 | 145 |
146 } // namespace | 146 } // namespace |
147 | 147 |
148 MojoResult MojoMain(MojoHandle shell_handle) { | 148 MojoResult ServiceMain(MojoHandle service_request_handle) { |
149 Package* package = new Package; | 149 Package* package = new Package; |
150 shell::ServiceRunner runner(package); | 150 shell::ServiceRunner runner(package); |
151 package->set_runner(&runner); | 151 package->set_runner(&runner); |
152 return runner.Run(shell_handle); | 152 return runner.Run(service_request_handle); |
153 } | 153 } |
OLD | NEW |