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_PUBLIC_BROWSER_BROWSER_CHILD_PROCESS_HOST_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_BROWSER_CHILD_PROCESS_HOST_H_ |
6 #define CONTENT_PUBLIC_BROWSER_BROWSER_CHILD_PROCESS_HOST_H_ | 6 #define CONTENT_PUBLIC_BROWSER_BROWSER_CHILD_PROCESS_HOST_H_ |
7 | 7 |
8 #include "base/environment.h" | 8 #include "base/environment.h" |
9 #include "base/memory/shared_memory.h" | 9 #include "base/memory/shared_memory.h" |
10 #include "base/process/kill.h" | 10 #include "base/process/kill.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 const std::string& service_name); | 51 const std::string& service_name); |
52 | 52 |
53 // Returns the child process host with unique id |child_process_id|, or | 53 // Returns the child process host with unique id |child_process_id|, or |
54 // nullptr if it doesn't exist. |child_process_id| is NOT the process ID, but | 54 // nullptr if it doesn't exist. |child_process_id| is NOT the process ID, but |
55 // is the same unique ID as |ChildProcessData::id|. | 55 // is the same unique ID as |ChildProcessData::id|. |
56 static BrowserChildProcessHost* FromID(int child_process_id); | 56 static BrowserChildProcessHost* FromID(int child_process_id); |
57 | 57 |
58 ~BrowserChildProcessHost() override {} | 58 ~BrowserChildProcessHost() override {} |
59 | 59 |
60 // Derived classes call this to launch the child process asynchronously. | 60 // Derived classes call this to launch the child process asynchronously. |
61 // Takes ownership of |cmd_line| and |delegate|. | 61 virtual void Launch( |
62 virtual void Launch(SandboxedProcessLauncherDelegate* delegate, | 62 std::unique_ptr<SandboxedProcessLauncherDelegate> delegate, |
63 base::CommandLine* cmd_line, | 63 std::unique_ptr<base::CommandLine> cmd_line, |
64 bool terminate_on_shutdown) = 0; | 64 bool terminate_on_shutdown) = 0; |
65 | 65 |
66 virtual const ChildProcessData& GetData() const = 0; | 66 virtual const ChildProcessData& GetData() const = 0; |
67 | 67 |
68 // Returns the ChildProcessHost object used by this object. | 68 // Returns the ChildProcessHost object used by this object. |
69 virtual ChildProcessHost* GetHost() const = 0; | 69 virtual ChildProcessHost* GetHost() const = 0; |
70 | 70 |
71 // Returns the termination status of a child. |exit_code| is the | 71 // Returns the termination status of a child. |exit_code| is the |
72 // status returned when the process exited (for posix, as returned | 72 // status returned when the process exited (for posix, as returned |
73 // from waitpid(), for Windows, as returned from | 73 // from waitpid(), for Windows, as returned from |
74 // GetExitCodeProcess()). |exit_code| may be nullptr. | 74 // GetExitCodeProcess()). |exit_code| may be nullptr. |
(...skipping 22 matching lines...) Expand all Loading... |
97 | 97 |
98 #if defined(OS_MACOSX) | 98 #if defined(OS_MACOSX) |
99 // Returns a PortProvider used to get the task port for child processes. | 99 // Returns a PortProvider used to get the task port for child processes. |
100 static base::PortProvider* GetPortProvider(); | 100 static base::PortProvider* GetPortProvider(); |
101 #endif | 101 #endif |
102 }; | 102 }; |
103 | 103 |
104 }; // namespace content | 104 }; // namespace content |
105 | 105 |
106 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CHILD_PROCESS_HOST_H_ | 106 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CHILD_PROCESS_HOST_H_ |
OLD | NEW |