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 <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/message_loop/message_loop.h" | 13 #include "base/message_loop/message_loop.h" |
14 #include "base/run_loop.h" | 14 #include "base/run_loop.h" |
15 #include "base/threading/simple_thread.h" | 15 #include "base/threading/simple_thread.h" |
16 #include "mojo/public/c/system/main.h" | |
17 #include "mojo/public/cpp/bindings/binding_set.h" | 16 #include "mojo/public/cpp/bindings/binding_set.h" |
| 17 #include "services/shell/public/c/main.h" |
18 #include "services/shell/public/cpp/connector.h" | 18 #include "services/shell/public/cpp/connector.h" |
19 #include "services/shell/public/cpp/interface_factory.h" | 19 #include "services/shell/public/cpp/interface_factory.h" |
20 #include "services/shell/public/cpp/service.h" | 20 #include "services/shell/public/cpp/service.h" |
21 #include "services/shell/public/cpp/service_runner.h" | 21 #include "services/shell/public/cpp/service_runner.h" |
22 #include "services/shell/public/interfaces/service_factory.mojom.h" | 22 #include "services/shell/public/interfaces/service_factory.mojom.h" |
23 #include "services/shell/tests/connect/connect_test.mojom.h" | 23 #include "services/shell/tests/connect/connect_test.mojom.h" |
24 | 24 |
25 // Tests that multiple applications can be packaged in a single Mojo application | 25 // Tests that multiple applications can be packaged in a single Mojo application |
26 // implementing ServiceFactory; that these applications can be specified by | 26 // implementing ServiceFactory; that these applications can be specified by |
27 // the package's manifest and are thus registered with the PackageManager. | 27 // the package's manifest and are thus registered with the PackageManager. |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 Identity identity_; | 219 Identity identity_; |
220 std::vector<std::unique_ptr<Service>> delegates_; | 220 std::vector<std::unique_ptr<Service>> delegates_; |
221 mojo::BindingSet<mojom::ServiceFactory> service_factory_bindings_; | 221 mojo::BindingSet<mojom::ServiceFactory> service_factory_bindings_; |
222 mojo::BindingSet<test::mojom::ConnectTestService> bindings_; | 222 mojo::BindingSet<test::mojom::ConnectTestService> bindings_; |
223 | 223 |
224 DISALLOW_COPY_AND_ASSIGN(ConnectTestService); | 224 DISALLOW_COPY_AND_ASSIGN(ConnectTestService); |
225 }; | 225 }; |
226 | 226 |
227 } // namespace shell | 227 } // namespace shell |
228 | 228 |
229 MojoResult MojoMain(MojoHandle shell_handle) { | 229 MojoResult ServiceMain(MojoHandle service_request_handle) { |
230 MojoResult rv = shell::ServiceRunner(new shell::ConnectTestService) | 230 shell::ServiceRunner runner(new shell::ConnectTestService); |
231 .Run(shell_handle); | 231 return runner.Run(service_request_handle); |
232 return rv; | |
233 } | 232 } |
OLD | NEW |