OLD | NEW |
| (Empty) |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CONTENT_CHILD_MOJO_MOJO_APPLICATION_H_ | |
6 #define CONTENT_CHILD_MOJO_MOJO_APPLICATION_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "base/macros.h" | |
11 #include "services/shell/public/cpp/interface_provider.h" | |
12 #include "services/shell/public/cpp/interface_registry.h" | |
13 | |
14 namespace content { | |
15 | |
16 // MojoApplication represents the code needed to setup a child process as a | |
17 // Mojo application. Instantiate MojoApplication and call InitWithToken() with | |
18 // a token passed from the process host. It makes the ServiceRegistry interface | |
19 // available. | |
20 class MojoApplication { | |
21 public: | |
22 MojoApplication(); | |
23 virtual ~MojoApplication(); | |
24 | |
25 // Initializes this MojoApplicaiton with a message pipe obtained using | |
26 // |token|. | |
27 void InitWithToken(const std::string& token); | |
28 | |
29 shell::InterfaceRegistry* interface_registry() { | |
30 return interface_registry_.get(); | |
31 } | |
32 shell::InterfaceProvider* remote_interfaces() { | |
33 return remote_interfaces_.get(); | |
34 } | |
35 | |
36 private: | |
37 std::unique_ptr<shell::InterfaceRegistry> interface_registry_; | |
38 std::unique_ptr<shell::InterfaceProvider> remote_interfaces_; | |
39 | |
40 DISALLOW_COPY_AND_ASSIGN(MojoApplication); | |
41 }; | |
42 | |
43 } // namespace content | |
44 | |
45 #endif // CONTENT_CHILD_MOJO_MOJO_APPLICATION_H_ | |
OLD | NEW |