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/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
16 #include "base/process/process.h" | 16 #include "base/process/process.h" |
17 #include "base/single_thread_task_runner.h" | 17 #include "base/single_thread_task_runner.h" |
18 #include "base/synchronization/waitable_event_watcher.h" | 18 #include "base/synchronization/waitable_event_watcher.h" |
19 #include "build/build_config.h" | 19 #include "build/build_config.h" |
20 #include "content/browser/child_process_launcher.h" | 20 #include "content/browser/child_process_launcher.h" |
21 #include "content/browser/power_monitor_message_broadcaster.h" | 21 #include "content/browser/power_monitor_message_broadcaster.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 | 25 |
26 #if defined(OS_WIN) | 26 #if defined(OS_WIN) |
| 27 #include "base/memory/shared_memory.h" |
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 shell { | 35 namespace shell { |
35 class InterfaceProvider; | 36 class InterfaceProvider; |
36 } | 37 } |
(...skipping 21 matching lines...) Expand all Loading... |
58 const std::string& service_name); | 59 const std::string& service_name); |
59 ~BrowserChildProcessHostImpl() override; | 60 ~BrowserChildProcessHostImpl() override; |
60 | 61 |
61 // Terminates all child processes and deletes each BrowserChildProcessHost | 62 // Terminates all child processes and deletes each BrowserChildProcessHost |
62 // instance. | 63 // instance. |
63 static void TerminateAll(); | 64 static void TerminateAll(); |
64 | 65 |
65 // Copies kEnableFeatures and kDisableFeatures to the command line. Generates | 66 // Copies kEnableFeatures and kDisableFeatures to the command line. Generates |
66 // them from the FeatureList override state, to take into account overrides | 67 // them from the FeatureList override state, to take into account overrides |
67 // from FieldTrials. | 68 // from FieldTrials. |
| 69 #if defined(OS_WIN) |
| 70 static void CopyFeatureAndFieldTrialFlags(base::CommandLine* cmd_line, |
| 71 base::SharedMemory* shared_memory); |
| 72 #else |
68 static void CopyFeatureAndFieldTrialFlags(base::CommandLine* cmd_line); | 73 static void CopyFeatureAndFieldTrialFlags(base::CommandLine* cmd_line); |
| 74 #endif |
69 | 75 |
70 // BrowserChildProcessHost implementation: | 76 // BrowserChildProcessHost implementation: |
71 bool Send(IPC::Message* message) override; | 77 bool Send(IPC::Message* message) override; |
72 void Launch(SandboxedProcessLauncherDelegate* delegate, | 78 void Launch(SandboxedProcessLauncherDelegate* delegate, |
| 79 #if defined(OS_WIN) |
| 80 HANDLE field_trial_handle, |
| 81 #endif |
73 base::CommandLine* cmd_line, | 82 base::CommandLine* cmd_line, |
74 bool terminate_on_shutdown) override; | 83 bool terminate_on_shutdown) override; |
75 const ChildProcessData& GetData() const override; | 84 const ChildProcessData& GetData() const override; |
76 ChildProcessHost* GetHost() const override; | 85 ChildProcessHost* GetHost() const override; |
77 base::TerminationStatus GetTerminationStatus(bool known_dead, | 86 base::TerminationStatus GetTerminationStatus(bool known_dead, |
78 int* exit_code) override; | 87 int* exit_code) override; |
79 std::unique_ptr<base::SharedPersistentMemoryAllocator> TakeMetricsAllocator() | 88 std::unique_ptr<base::SharedPersistentMemoryAllocator> TakeMetricsAllocator() |
80 override; | 89 override; |
81 void SetName(const base::string16& name) override; | 90 void SetName(const base::string16& name) override; |
82 void SetHandle(base::ProcessHandle handle) override; | 91 void SetHandle(base::ProcessHandle handle) override; |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 | 180 |
172 bool is_channel_connected_; | 181 bool is_channel_connected_; |
173 bool notify_child_disconnected_; | 182 bool notify_child_disconnected_; |
174 | 183 |
175 base::WeakPtrFactory<BrowserChildProcessHostImpl> weak_factory_; | 184 base::WeakPtrFactory<BrowserChildProcessHostImpl> weak_factory_; |
176 }; | 185 }; |
177 | 186 |
178 } // namespace content | 187 } // namespace content |
179 | 188 |
180 #endif // CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_IMPL_H_ | 189 #endif // CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_IMPL_H_ |
OLD | NEW |