Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(392)

Side by Side Diff: content/browser/child_process_launcher_helper.h

Issue 2950153002: Improve process launch handle sharing API. (Closed)
Patch Set: Fix Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 namespace base { 35 namespace base {
36 class CommandLine; 36 class CommandLine;
37 } 37 }
38 38
39 namespace content { 39 namespace content {
40 40
41 class ChildProcessLauncher; 41 class ChildProcessLauncher;
42 class FileDescriptorInfo;
43 class SandboxedProcessLauncherDelegate; 42 class SandboxedProcessLauncherDelegate;
44 43
44 #if defined(OS_POSIX)
45 class PosixFileDescriptorInfo;
46 #endif
47
45 namespace internal { 48 namespace internal {
46 49
47 50
48 #if defined(OS_WIN) 51 #if defined(OS_WIN)
49 using FileMappedForLaunch = base::HandlesToInheritVector; 52 using FileMappedForLaunch = std::vector<HANDLE>;
50 #else 53 #else
51 using FileMappedForLaunch = FileDescriptorInfo; 54 using FileMappedForLaunch = PosixFileDescriptorInfo;
52 #endif 55 #endif
53 56
54 // ChildProcessLauncherHelper is used by ChildProcessLauncher to start a 57 // ChildProcessLauncherHelper is used by ChildProcessLauncher to start a
55 // process. Since ChildProcessLauncher can be deleted by its client at any time, 58 // process. Since ChildProcessLauncher can be deleted by its client at any time,
56 // this class is used to keep state as the process is started asynchronously. 59 // this class is used to keep state as the process is started asynchronously.
57 // It also contains the platform specific pieces. 60 // It also contains the platform specific pieces.
58 class ChildProcessLauncherHelper : 61 class ChildProcessLauncherHelper :
59 public base::RefCountedThreadSafe<ChildProcessLauncherHelper> { 62 public base::RefCountedThreadSafe<ChildProcessLauncherHelper> {
60 public: 63 public:
61 // Abstraction around a process required to deal in a platform independent way 64 // Abstraction around a process required to deal in a platform independent way
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 #if defined(OS_ANDROID) 204 #if defined(OS_ANDROID)
202 base::android::ScopedJavaGlobalRef<jobject> java_peer_; 205 base::android::ScopedJavaGlobalRef<jobject> java_peer_;
203 #endif 206 #endif
204 }; 207 };
205 208
206 } // namespace internal 209 } // namespace internal
207 210
208 } // namespace content 211 } // namespace content
209 212
210 #endif // CONTENT_BROWSER_CHILD_PROCESS_LAUNCHER_HELPER_H_ 213 #endif // CONTENT_BROWSER_CHILD_PROCESS_LAUNCHER_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698