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 | 10 |
10 #include "base/macros.h" | 11 #include "base/macros.h" |
11 #include "base/process/process_handle.h" | 12 #include "base/process/process_handle.h" |
12 #include "build/build_config.h" | 13 #include "build/build_config.h" |
13 #include "content/common/application_setup.mojom.h" | 14 #include "content/common/application_setup.mojom.h" |
14 #include "content/common/mojo/channel_init.h" | 15 #include "content/common/mojo/channel_init.h" |
15 #include "content/common/mojo/service_registry_impl.h" | 16 #include "content/common/mojo/service_registry_impl.h" |
16 #include "mojo/edk/embedder/scoped_platform_handle.h" | 17 #include "mojo/edk/embedder/scoped_platform_handle.h" |
17 #include "mojo/public/cpp/system/message_pipe.h" | 18 #include "mojo/public/cpp/system/message_pipe.h" |
18 | 19 |
(...skipping 16 matching lines...) Expand all Loading... |
35 public: | 36 public: |
36 MojoApplicationHost(); | 37 MojoApplicationHost(); |
37 ~MojoApplicationHost(); | 38 ~MojoApplicationHost(); |
38 | 39 |
39 // Two-phase initialization: | 40 // Two-phase initialization: |
40 // 1- Init makes service_registry() available synchronously. | 41 // 1- Init makes service_registry() available synchronously. |
41 // 2- Activate establishes the actual connection to the peer process. | 42 // 2- Activate establishes the actual connection to the peer process. |
42 bool Init(); | 43 bool Init(); |
43 void Activate(IPC::Sender* sender, base::ProcessHandle process_handle); | 44 void Activate(IPC::Sender* sender, base::ProcessHandle process_handle); |
44 | 45 |
| 46 // Use a shared token to initialize the application. Returns a token to pass |
| 47 // to the child process. |
| 48 std::string InitWithToken(); |
| 49 |
45 ServiceRegistry* service_registry() { return &service_registry_; } | 50 ServiceRegistry* service_registry() { return &service_registry_; } |
46 | 51 |
47 #if defined(OS_ANDROID) | 52 #if defined(OS_ANDROID) |
48 ServiceRegistryAndroid* service_registry_android() { | 53 ServiceRegistryAndroid* service_registry_android() { |
49 return service_registry_android_.get(); | 54 return service_registry_android_.get(); |
50 } | 55 } |
51 #endif | 56 #endif |
52 | 57 |
53 void OverrideIOTaskRunnerForTest( | 58 void OverrideIOTaskRunnerForTest( |
54 scoped_refptr<base::TaskRunner> io_task_runner); | 59 scoped_refptr<base::TaskRunner> io_task_runner); |
(...skipping 12 matching lines...) Expand all Loading... |
67 #if defined(OS_ANDROID) | 72 #if defined(OS_ANDROID) |
68 std::unique_ptr<ServiceRegistryAndroid> service_registry_android_; | 73 std::unique_ptr<ServiceRegistryAndroid> service_registry_android_; |
69 #endif | 74 #endif |
70 | 75 |
71 DISALLOW_COPY_AND_ASSIGN(MojoApplicationHost); | 76 DISALLOW_COPY_AND_ASSIGN(MojoApplicationHost); |
72 }; | 77 }; |
73 | 78 |
74 } // namespace content | 79 } // namespace content |
75 | 80 |
76 #endif // CONTENT_BROWSER_MOJO_MOJO_APPLICATION_HOST_H_ | 81 #endif // CONTENT_BROWSER_MOJO_MOJO_APPLICATION_HOST_H_ |
OLD | NEW |