| 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/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
| 16 #include "base/process/process.h" | 17 #include "base/process/process.h" |
| 17 #include "base/single_thread_task_runner.h" | 18 #include "base/single_thread_task_runner.h" |
| 18 #include "base/synchronization/waitable_event_watcher.h" | 19 #include "base/synchronization/waitable_event_watcher.h" |
| 19 #include "build/build_config.h" | 20 #include "build/build_config.h" |
| 20 #include "content/browser/child_process_launcher.h" | 21 #include "content/browser/child_process_launcher.h" |
| 21 #include "content/browser/power_monitor_message_broadcaster.h" | 22 #include "content/browser/power_monitor_message_broadcaster.h" |
| 22 #include "content/public/browser/browser_child_process_host.h" | 23 #include "content/public/browser/browser_child_process_host.h" |
| 23 #include "content/public/browser/child_process_data.h" | 24 #include "content/public/browser/child_process_data.h" |
| 24 #include "content/public/common/child_process_host_delegate.h" | 25 #include "content/public/common/child_process_host_delegate.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after 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. |
| 68 static void CopyFeatureAndFieldTrialFlags(base::CommandLine* cmd_line); | 69 static std::unique_ptr<base::SharedMemory> CopyFeatureAndFieldTrialFlags( |
| 70 base::CommandLine* cmd_line); |
| 69 | 71 |
| 70 // BrowserChildProcessHost implementation: | 72 // BrowserChildProcessHost implementation: |
| 71 bool Send(IPC::Message* message) override; | 73 bool Send(IPC::Message* message) override; |
| 72 void Launch(SandboxedProcessLauncherDelegate* delegate, | 74 void Launch(SandboxedProcessLauncherDelegate* delegate, |
| 73 base::CommandLine* cmd_line, | 75 base::CommandLine* cmd_line, |
| 76 const base::SharedMemory* field_trial_state, |
| 74 bool terminate_on_shutdown) override; | 77 bool terminate_on_shutdown) override; |
| 75 const ChildProcessData& GetData() const override; | 78 const ChildProcessData& GetData() const override; |
| 76 ChildProcessHost* GetHost() const override; | 79 ChildProcessHost* GetHost() const override; |
| 77 base::TerminationStatus GetTerminationStatus(bool known_dead, | 80 base::TerminationStatus GetTerminationStatus(bool known_dead, |
| 78 int* exit_code) override; | 81 int* exit_code) override; |
| 79 std::unique_ptr<base::SharedPersistentMemoryAllocator> TakeMetricsAllocator() | 82 std::unique_ptr<base::SharedPersistentMemoryAllocator> TakeMetricsAllocator() |
| 80 override; | 83 override; |
| 81 void SetName(const base::string16& name) override; | 84 void SetName(const base::string16& name) override; |
| 82 void SetHandle(base::ProcessHandle handle) override; | 85 void SetHandle(base::ProcessHandle handle) override; |
| 83 | 86 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 | 174 |
| 172 bool is_channel_connected_; | 175 bool is_channel_connected_; |
| 173 bool notify_child_disconnected_; | 176 bool notify_child_disconnected_; |
| 174 | 177 |
| 175 base::WeakPtrFactory<BrowserChildProcessHostImpl> weak_factory_; | 178 base::WeakPtrFactory<BrowserChildProcessHostImpl> weak_factory_; |
| 176 }; | 179 }; |
| 177 | 180 |
| 178 } // namespace content | 181 } // namespace content |
| 179 | 182 |
| 180 #endif // CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_IMPL_H_ | 183 #endif // CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_IMPL_H_ |
| OLD | NEW |