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/cpp/bindings/binding_set.h" | 16 #include "mojo/public/cpp/bindings/binding_set.h" |
17 #include "services/shell/public/c/main.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 services can be packaged in a single service by |
26 // implementing ServiceFactory; that these applications can be specified by | 26 // implementing ServiceFactory; that these services 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. |
28 | 28 |
29 namespace shell { | 29 namespace shell { |
30 | 30 |
31 namespace { | 31 namespace { |
32 | 32 |
33 void QuitLoop(base::RunLoop* loop) { | 33 void QuitLoop(base::RunLoop* loop) { |
34 loop->Quit(); | 34 loop->Quit(); |
35 } | 35 } |
36 | 36 |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 ServiceMain(MojoHandle service_request_handle) { | 229 MojoResult ServiceMain(MojoHandle service_request_handle) { |
230 shell::ServiceRunner runner(new shell::ConnectTestService); | 230 shell::ServiceRunner runner(new shell::ConnectTestService); |
231 return runner.Run(service_request_handle); | 231 return runner.Run(service_request_handle); |
232 } | 232 } |
OLD | NEW |