OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_BROWSER_CHILD_PROCESS_HOST_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_IMPL_H_ |
6 #define CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_IMPL_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <list> | 10 #include <list> |
11 #include <memory> | 11 #include <memory> |
12 | 12 |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "base/memory/shared_memory.h" | 15 #include "base/memory/shared_memory.h" |
16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
17 #include "base/process/process.h" | 17 #include "base/process/process.h" |
18 #include "base/single_thread_task_runner.h" | 18 #include "base/single_thread_task_runner.h" |
19 #include "base/synchronization/waitable_event_watcher.h" | 19 #include "base/synchronization/waitable_event_watcher.h" |
20 #include "build/build_config.h" | 20 #include "build/build_config.h" |
21 #include "content/browser/child_process_launcher.h" | 21 #include "content/browser/child_process_launcher.h" |
22 #include "content/public/browser/browser_child_process_host.h" | 22 #include "content/public/browser/browser_child_process_host.h" |
23 #include "content/public/browser/child_process_data.h" | 23 #include "content/public/browser/child_process_data.h" |
24 #include "content/public/common/child_process_host_delegate.h" | 24 #include "content/public/common/child_process_host_delegate.h" |
| 25 #include "mojo/edk/embedder/pending_process_connection.h" |
25 | 26 |
26 #if defined(OS_WIN) | 27 #if defined(OS_WIN) |
27 #include "base/win/object_watcher.h" | 28 #include "base/win/object_watcher.h" |
28 #endif | 29 #endif |
29 | 30 |
30 namespace base { | 31 namespace base { |
31 class CommandLine; | 32 class CommandLine; |
32 } | 33 } |
33 | 34 |
34 namespace service_manager { | 35 namespace service_manager { |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 | 150 |
150 #if defined(OS_WIN) | 151 #if defined(OS_WIN) |
151 // ObjectWatcher::Delegate implementation. | 152 // ObjectWatcher::Delegate implementation. |
152 void OnObjectSignaled(HANDLE object) override; | 153 void OnObjectSignaled(HANDLE object) override; |
153 #endif | 154 #endif |
154 | 155 |
155 ChildProcessData data_; | 156 ChildProcessData data_; |
156 BrowserChildProcessHostDelegate* delegate_; | 157 BrowserChildProcessHostDelegate* delegate_; |
157 std::unique_ptr<ChildProcessHost> child_process_host_; | 158 std::unique_ptr<ChildProcessHost> child_process_host_; |
158 | 159 |
159 const std::string child_token_; | 160 std::unique_ptr<mojo::edk::PendingProcessConnection> pending_connection_; |
160 std::unique_ptr<ChildConnection> child_connection_; | 161 std::unique_ptr<ChildConnection> child_connection_; |
161 | 162 |
162 std::unique_ptr<ChildProcessLauncher> child_process_; | 163 std::unique_ptr<ChildProcessLauncher> child_process_; |
163 | 164 |
164 #if defined(OS_WIN) | 165 #if defined(OS_WIN) |
165 // Watches to see if the child process exits before the IPC channel has | 166 // Watches to see if the child process exits before the IPC channel has |
166 // been connected. Thereafter, its exit is determined by an error on the | 167 // been connected. Thereafter, its exit is determined by an error on the |
167 // IPC channel. | 168 // IPC channel. |
168 base::win::ObjectWatcher early_exit_watcher_; | 169 base::win::ObjectWatcher early_exit_watcher_; |
169 #endif | 170 #endif |
170 | 171 |
171 // The memory allocator, if any, in which the process will write its metrics. | 172 // The memory allocator, if any, in which the process will write its metrics. |
172 std::unique_ptr<base::SharedPersistentMemoryAllocator> metrics_allocator_; | 173 std::unique_ptr<base::SharedPersistentMemoryAllocator> metrics_allocator_; |
173 | 174 |
174 IPC::Channel* channel_ = nullptr; | 175 IPC::Channel* channel_ = nullptr; |
175 bool is_channel_connected_; | 176 bool is_channel_connected_; |
176 bool notify_child_disconnected_; | 177 bool notify_child_disconnected_; |
177 | 178 |
178 base::WeakPtrFactory<BrowserChildProcessHostImpl> weak_factory_; | 179 base::WeakPtrFactory<BrowserChildProcessHostImpl> weak_factory_; |
179 }; | 180 }; |
180 | 181 |
181 } // namespace content | 182 } // namespace content |
182 | 183 |
183 #endif // CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_IMPL_H_ | 184 #endif // CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_IMPL_H_ |
OLD | NEW |