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_CHILD_PROCESS_LAUNCHER_H_ | 5 #ifndef CONTENT_BROWSER_CHILD_PROCESS_LAUNCHER_H_ |
6 #define CONTENT_BROWSER_CHILD_PROCESS_LAUNCHER_H_ | 6 #define CONTENT_BROWSER_CHILD_PROCESS_LAUNCHER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/process/kill.h" | 10 #include "base/process/kill.h" |
11 #include "base/process/launch.h" | 11 #include "base/process/launch.h" |
| 12 #include "base/process/process.h" |
12 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
13 | 14 |
14 namespace base { | 15 namespace base { |
15 class CommandLine; | 16 class CommandLine; |
16 } | 17 } |
17 | 18 |
18 namespace content { | 19 namespace content { |
19 class SandboxedProcessLauncherDelegate; | 20 class SandboxedProcessLauncherDelegate; |
20 | 21 |
21 // Launches a process asynchronously and notifies the client of the process | 22 // Launches a process asynchronously and notifies the client of the process |
(...skipping 21 matching lines...) Expand all Loading... |
43 ChildProcessLauncher( | 44 ChildProcessLauncher( |
44 SandboxedProcessLauncherDelegate* delegate, | 45 SandboxedProcessLauncherDelegate* delegate, |
45 base::CommandLine* cmd_line, | 46 base::CommandLine* cmd_line, |
46 int child_process_id, | 47 int child_process_id, |
47 Client* client); | 48 Client* client); |
48 ~ChildProcessLauncher(); | 49 ~ChildProcessLauncher(); |
49 | 50 |
50 // True if the process is being launched and so the handle isn't available. | 51 // True if the process is being launched and so the handle isn't available. |
51 bool IsStarting(); | 52 bool IsStarting(); |
52 | 53 |
53 // Getter for the process handle. Only call after the process has started. | 54 // Getter for the process. Only call after the process has started. |
54 base::ProcessHandle GetHandle(); | 55 const base::Process& GetProcess() const; |
55 | 56 |
56 // Call this when the child process exits to know what happened to it. | 57 // Call this when the child process exits to know what happened to it. |
57 // |known_dead| can be true if we already know the process is dead as it can | 58 // |known_dead| can be true if we already know the process is dead as it can |
58 // help the implemention figure the proper TerminationStatus. | 59 // help the implemention figure the proper TerminationStatus. |
59 // On Linux, the use of |known_dead| is subtle and can be crucial if an | 60 // On Linux, the use of |known_dead| is subtle and can be crucial if an |
60 // accurate status is important. With |known_dead| set to false, a dead | 61 // accurate status is important. With |known_dead| set to false, a dead |
61 // process could be seen as running. With |known_dead| set to true, the | 62 // process could be seen as running. With |known_dead| set to true, the |
62 // process will be killed if it was still running. See ZygoteHostImpl for | 63 // process will be killed if it was still running. See ZygoteHostImpl for |
63 // more discussion of Linux implementation details. | 64 // more discussion of Linux implementation details. |
64 // |exit_code| is the exit code of the process if it exited (e.g. status from | 65 // |exit_code| is the exit code of the process if it exited (e.g. status from |
(...skipping 14 matching lines...) Expand all Loading... |
79 class Context; | 80 class Context; |
80 | 81 |
81 scoped_refptr<Context> context_; | 82 scoped_refptr<Context> context_; |
82 | 83 |
83 DISALLOW_COPY_AND_ASSIGN(ChildProcessLauncher); | 84 DISALLOW_COPY_AND_ASSIGN(ChildProcessLauncher); |
84 }; | 85 }; |
85 | 86 |
86 } // namespace content | 87 } // namespace content |
87 | 88 |
88 #endif // CONTENT_BROWSER_CHILD_PROCESS_LAUNCHER_H_ | 89 #endif // CONTENT_BROWSER_CHILD_PROCESS_LAUNCHER_H_ |
OLD | NEW |