| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_CHILD_PROCESS_LAUNCHER_HELPER_H_ | 5 #ifndef CONTENT_BROWSER_CHILD_PROCESS_LAUNCHER_HELPER_H_ |
| 6 #define CONTENT_BROWSER_CHILD_PROCESS_LAUNCHER_HELPER_H_ | 6 #define CONTENT_BROWSER_CHILD_PROCESS_LAUNCHER_HELPER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/process/kill.h" | 12 #include "base/process/kill.h" |
| 13 #include "base/process/process.h" | 13 #include "base/process/process.h" |
| 14 #include "build/build_config.h" | 14 #include "build/build_config.h" |
| 15 #include "content/public/browser/browser_thread.h" | 15 #include "content/public/browser/browser_thread.h" |
| 16 #include "content/public/common/result_codes.h" | 16 #include "content/public/common/result_codes.h" |
| 17 #include "mojo/edk/embedder/embedder.h" | 17 #include "mojo/edk/embedder/embedder.h" |
| 18 #include "mojo/edk/embedder/scoped_platform_handle.h" | 18 #include "mojo/edk/embedder/scoped_platform_handle.h" |
| 19 #include "services/catalog/public/cpp/manifest_parsing_util.h" |
| 19 | 20 |
| 20 #if defined(OS_WIN) | 21 #if defined(OS_WIN) |
| 21 #include "sandbox/win/src/sandbox_types.h" | 22 #include "sandbox/win/src/sandbox_types.h" |
| 22 #else | 23 #else |
| 23 #include "content/public/browser/file_descriptor_info.h" | 24 #include "content/public/browser/file_descriptor_info.h" |
| 24 #endif | 25 #endif |
| 25 | 26 |
| 26 #if defined(OS_LINUX) | 27 #if defined(OS_LINUX) |
| 27 #include "content/public/common/zygote_handle.h" | 28 #include "content/public/common/zygote_handle.h" |
| 28 #endif | 29 #endif |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 // Terminates the process with the normal exit code and ensures it has been | 149 // Terminates the process with the normal exit code and ensures it has been |
| 149 // stopped. By returning a normal exit code this ensures UMA won't treat this | 150 // stopped. By returning a normal exit code this ensures UMA won't treat this |
| 150 // as a crash. | 151 // as a crash. |
| 151 // Returns immediately and perform the work on the launcher thread. | 152 // Returns immediately and perform the work on the launcher thread. |
| 152 static void ForceNormalProcessTerminationAsync( | 153 static void ForceNormalProcessTerminationAsync( |
| 153 ChildProcessLauncherHelper::Process process); | 154 ChildProcessLauncherHelper::Process process); |
| 154 | 155 |
| 155 static void SetProcessBackgroundedOnLauncherThread( | 156 static void SetProcessBackgroundedOnLauncherThread( |
| 156 base::Process process, bool background); | 157 base::Process process, bool background); |
| 157 | 158 |
| 159 static void SetRegisteredFilesForService( |
| 160 const std::string& service_name, |
| 161 catalog::RequiredFileMap required_files); |
| 162 |
| 158 private: | 163 private: |
| 159 friend class base::RefCountedThreadSafe<ChildProcessLauncherHelper>; | 164 friend class base::RefCountedThreadSafe<ChildProcessLauncherHelper>; |
| 160 | 165 |
| 161 ~ChildProcessLauncherHelper(); | 166 ~ChildProcessLauncherHelper(); |
| 162 | 167 |
| 163 void LaunchOnLauncherThread(); | 168 void LaunchOnLauncherThread(); |
| 164 | 169 |
| 165 const mojo::edk::PlatformHandle& mojo_client_handle() const { | 170 const mojo::edk::PlatformHandle& mojo_client_handle() const { |
| 166 return mojo_client_handle_.get(); | 171 return mojo_client_handle_.get(); |
| 167 } | 172 } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 182 mojo::edk::ScopedPlatformHandle mojo_client_handle_; | 187 mojo::edk::ScopedPlatformHandle mojo_client_handle_; |
| 183 mojo::edk::ScopedPlatformHandle mojo_server_handle_; | 188 mojo::edk::ScopedPlatformHandle mojo_server_handle_; |
| 184 bool terminate_on_shutdown_; | 189 bool terminate_on_shutdown_; |
| 185 }; | 190 }; |
| 186 | 191 |
| 187 } // namespace internal | 192 } // namespace internal |
| 188 | 193 |
| 189 } // namespace content | 194 } // namespace content |
| 190 | 195 |
| 191 #endif // CONTENT_BROWSER_CHILD_PROCESS_LAUNCHER_HELPER_H_ | 196 #endif // CONTENT_BROWSER_CHILD_PROCESS_LAUNCHER_HELPER_H_ |
| OLD | NEW |