OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef CONTENT_BROWSER_MOJO_MOJO_APPLICATION_HOST_H_ | 5 #ifndef CONTENT_BROWSER_MOJO_MOJO_APPLICATION_HOST_H_ |
6 #define CONTENT_BROWSER_MOJO_MOJO_APPLICATION_HOST_H_ | 6 #define CONTENT_BROWSER_MOJO_MOJO_APPLICATION_HOST_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 | 23 |
24 namespace content { | 24 namespace content { |
25 | 25 |
26 // MojoApplicationHost represents the code needed on the browser side to setup | 26 // MojoApplicationHost represents the code needed on the browser side to setup |
27 // a child process as a Mojo application. The child process should use the token | 27 // a child process as a Mojo application. The child process should use the token |
28 // from GetToken() to initialize its MojoApplication. MojoApplicationHost makes | 28 // from GetToken() to initialize its MojoApplication. MojoApplicationHost makes |
29 // the ServiceRegistry interface available so that child-provided services can | 29 // the ServiceRegistry interface available so that child-provided services can |
30 // be invoked. | 30 // be invoked. |
31 class CONTENT_EXPORT MojoApplicationHost { | 31 class CONTENT_EXPORT MojoApplicationHost { |
32 public: | 32 public: |
33 MojoApplicationHost(); | 33 explicit MojoApplicationHost(const std::string& child_token); |
34 ~MojoApplicationHost(); | 34 ~MojoApplicationHost(); |
35 | 35 |
36 // Returns a token to pass to the child process to initialize its | 36 // Returns a token to pass to the child process to initialize its |
37 // MojoApplication. | 37 // MojoApplication. |
38 const std::string& GetToken() { return token_; } | 38 const std::string& GetToken() { return token_; } |
39 | 39 |
40 ServiceRegistry* service_registry() { return &service_registry_; } | 40 ServiceRegistry* service_registry() { return &service_registry_; } |
41 | 41 |
42 #if defined(OS_ANDROID) | 42 #if defined(OS_ANDROID) |
43 ServiceRegistryAndroid* service_registry_android() { | 43 ServiceRegistryAndroid* service_registry_android() { |
(...skipping 10 matching lines...) Expand all Loading... |
54 #if defined(OS_ANDROID) | 54 #if defined(OS_ANDROID) |
55 std::unique_ptr<ServiceRegistryAndroid> service_registry_android_; | 55 std::unique_ptr<ServiceRegistryAndroid> service_registry_android_; |
56 #endif | 56 #endif |
57 | 57 |
58 DISALLOW_COPY_AND_ASSIGN(MojoApplicationHost); | 58 DISALLOW_COPY_AND_ASSIGN(MojoApplicationHost); |
59 }; | 59 }; |
60 | 60 |
61 } // namespace content | 61 } // namespace content |
62 | 62 |
63 #endif // CONTENT_BROWSER_MOJO_MOJO_APPLICATION_HOST_H_ | 63 #endif // CONTENT_BROWSER_MOJO_MOJO_APPLICATION_HOST_H_ |
OLD | NEW |