| 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 #include "services/catalog/public/cpp/manifest_parsing_util.h" |
| 20 | 20 |
| 21 #if defined(OS_ANDROID) | 21 #if defined(OS_ANDROID) |
| 22 #include "base/android/scoped_java_ref.h" | 22 #include "base/android/scoped_java_ref.h" |
| 23 #endif | 23 #endif |
| 24 | 24 |
| 25 #if defined(OS_WIN) | 25 #if defined(OS_WIN) |
| 26 #include "sandbox/win/src/sandbox_types.h" | 26 #include "sandbox/win/src/sandbox_types.h" |
| 27 #else | 27 #else |
| 28 #include "content/public/browser/file_descriptor_info.h" | 28 #include "content/public/browser/posix_file_descriptor_info.h" |
| 29 #endif | 29 #endif |
| 30 | 30 |
| 31 #if defined(OS_LINUX) | 31 #if defined(OS_LINUX) |
| 32 #include "content/public/common/zygote_handle.h" | 32 #include "content/public/common/zygote_handle.h" |
| 33 #endif | 33 #endif |
| 34 | 34 |
| 35 #if defined(OS_MACOSX) | 35 #if defined(OS_MACOSX) |
| 36 #include "sandbox/mac/seatbelt_exec.h" | 36 #include "sandbox/mac/seatbelt_exec.h" |
| 37 #endif | 37 #endif |
| 38 | 38 |
| 39 namespace base { | 39 namespace base { |
| 40 class CommandLine; | 40 class CommandLine; |
| 41 } | 41 } |
| 42 | 42 |
| 43 namespace content { | 43 namespace content { |
| 44 | 44 |
| 45 class ChildProcessLauncher; | 45 class ChildProcessLauncher; |
| 46 class FileDescriptorInfo; | |
| 47 class SandboxedProcessLauncherDelegate; | 46 class SandboxedProcessLauncherDelegate; |
| 48 | 47 |
| 48 #if defined(OS_POSIX) |
| 49 class PosixFileDescriptorInfo; |
| 50 #endif |
| 51 |
| 49 namespace internal { | 52 namespace internal { |
| 50 | 53 |
| 51 | 54 #if defined(OS_POSIX) |
| 52 #if defined(OS_WIN) | 55 using FileMappedForLaunch = PosixFileDescriptorInfo; |
| 56 #else |
| 53 using FileMappedForLaunch = base::HandlesToInheritVector; | 57 using FileMappedForLaunch = base::HandlesToInheritVector; |
| 54 #else | |
| 55 using FileMappedForLaunch = FileDescriptorInfo; | |
| 56 #endif | 58 #endif |
| 57 | 59 |
| 58 // ChildProcessLauncherHelper is used by ChildProcessLauncher to start a | 60 // ChildProcessLauncherHelper is used by ChildProcessLauncher to start a |
| 59 // process. Since ChildProcessLauncher can be deleted by its client at any time, | 61 // process. Since ChildProcessLauncher can be deleted by its client at any time, |
| 60 // this class is used to keep state as the process is started asynchronously. | 62 // this class is used to keep state as the process is started asynchronously. |
| 61 // It also contains the platform specific pieces. | 63 // It also contains the platform specific pieces. |
| 62 class ChildProcessLauncherHelper : | 64 class ChildProcessLauncherHelper : |
| 63 public base::RefCountedThreadSafe<ChildProcessLauncherHelper> { | 65 public base::RefCountedThreadSafe<ChildProcessLauncherHelper> { |
| 64 public: | 66 public: |
| 65 // Abstraction around a process required to deal in a platform independent way | 67 // Abstraction around a process required to deal in a platform independent way |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 #if defined(OS_ANDROID) | 211 #if defined(OS_ANDROID) |
| 210 base::android::ScopedJavaGlobalRef<jobject> java_peer_; | 212 base::android::ScopedJavaGlobalRef<jobject> java_peer_; |
| 211 #endif | 213 #endif |
| 212 }; | 214 }; |
| 213 | 215 |
| 214 } // namespace internal | 216 } // namespace internal |
| 215 | 217 |
| 216 } // namespace content | 218 } // namespace content |
| 217 | 219 |
| 218 #endif // CONTENT_BROWSER_CHILD_PROCESS_LAUNCHER_HELPER_H_ | 220 #endif // CONTENT_BROWSER_CHILD_PROCESS_LAUNCHER_HELPER_H_ |
| OLD | NEW |