| 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" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 protected: | 32 protected: |
| 33 virtual ~Client() {} | 33 virtual ~Client() {} |
| 34 }; | 34 }; |
| 35 | 35 |
| 36 // Launches the process asynchronously, calling the client when the result is | 36 // Launches the process asynchronously, calling the client when the result is |
| 37 // ready. Deleting this object before the process is created is safe, since | 37 // ready. Deleting this object before the process is created is safe, since |
| 38 // the callback won't be called. If the process is still running by the time | 38 // the callback won't be called. If the process is still running by the time |
| 39 // this object destructs, it will be terminated. | 39 // this object destructs, it will be terminated. |
| 40 // Takes ownership of cmd_line. | 40 // Takes ownership of cmd_line. |
| 41 ChildProcessLauncher( | 41 ChildProcessLauncher( |
| 42 #if defined(OS_WIN) | |
| 43 SandboxedProcessLauncherDelegate* delegate, | 42 SandboxedProcessLauncherDelegate* delegate, |
| 44 bool launch_elevated, | |
| 45 #elif defined(OS_POSIX) | |
| 46 bool use_zygote, | |
| 47 const base::EnvironmentMap& environ, | |
| 48 int ipcfd, | |
| 49 #endif | |
| 50 CommandLine* cmd_line, | 43 CommandLine* cmd_line, |
| 51 int child_process_id, | 44 int child_process_id, |
| 52 Client* client); | 45 Client* client); |
| 53 ~ChildProcessLauncher(); | 46 ~ChildProcessLauncher(); |
| 54 | 47 |
| 55 // True if the process is being launched and so the handle isn't available. | 48 // True if the process is being launched and so the handle isn't available. |
| 56 bool IsStarting(); | 49 bool IsStarting(); |
| 57 | 50 |
| 58 // Getter for the process handle. Only call after the process has started. | 51 // Getter for the process handle. Only call after the process has started. |
| 59 base::ProcessHandle GetHandle(); | 52 base::ProcessHandle GetHandle(); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 84 class Context; | 77 class Context; |
| 85 | 78 |
| 86 scoped_refptr<Context> context_; | 79 scoped_refptr<Context> context_; |
| 87 | 80 |
| 88 DISALLOW_COPY_AND_ASSIGN(ChildProcessLauncher); | 81 DISALLOW_COPY_AND_ASSIGN(ChildProcessLauncher); |
| 89 }; | 82 }; |
| 90 | 83 |
| 91 } // namespace content | 84 } // namespace content |
| 92 | 85 |
| 93 #endif // CONTENT_BROWSER_CHILD_PROCESS_LAUNCHER_H_ | 86 #endif // CONTENT_BROWSER_CHILD_PROCESS_LAUNCHER_H_ |
| OLD | NEW |