| 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_util.h" | 10 #include "base/process_util.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 int child_process_id, | 46 int child_process_id, |
| 47 Client* client); | 47 Client* client); |
| 48 ~ChildProcessLauncher(); | 48 ~ChildProcessLauncher(); |
| 49 | 49 |
| 50 // True if the process is being launched and so the handle isn't available. | 50 // True if the process is being launched and so the handle isn't available. |
| 51 bool IsStarting(); | 51 bool IsStarting(); |
| 52 | 52 |
| 53 // Getter for the process handle. Only call after the process has started. | 53 // Getter for the process handle. Only call after the process has started. |
| 54 base::ProcessHandle GetHandle(); | 54 base::ProcessHandle GetHandle(); |
| 55 | 55 |
| 56 // Call this when the child process exits to know what happened to | 56 // Call this when the child process exits to know what happened to it. |
| 57 // it. |exit_code| is the exit code of the process if it exited | 57 // |known_dead| can be true if we already know the process is dead as it can |
| 58 // (e.g. status from waitpid if on posix, from GetExitCodeProcess on | 58 // help the implemention figure the proper TerminationStatus. |
| 59 // Windows). |exit_code| may be NULL. | 59 // |exit_code| is the exit code of the process if it exited (e.g. status from |
| 60 base::TerminationStatus GetChildTerminationStatus(int* exit_code); | 60 // waitpid if on posix, from GetExitCodeProcess on Windows). |exit_code| may |
| 61 // be NULL. |
| 62 base::TerminationStatus GetChildTerminationStatus(bool known_dead, |
| 63 int* exit_code); |
| 61 | 64 |
| 62 // Changes whether the process runs in the background or not. Only call | 65 // Changes whether the process runs in the background or not. Only call |
| 63 // this after the process has started. | 66 // this after the process has started. |
| 64 void SetProcessBackgrounded(bool background); | 67 void SetProcessBackgrounded(bool background); |
| 65 | 68 |
| 66 // Controls whether the child process should be terminated on browser | 69 // Controls whether the child process should be terminated on browser |
| 67 // shutdown. | 70 // shutdown. |
| 68 void SetTerminateChildOnShutdown(bool terminate_on_shutdown); | 71 void SetTerminateChildOnShutdown(bool terminate_on_shutdown); |
| 69 | 72 |
| 70 private: | 73 private: |
| 71 class Context; | 74 class Context; |
| 72 | 75 |
| 73 scoped_refptr<Context> context_; | 76 scoped_refptr<Context> context_; |
| 74 | 77 |
| 75 DISALLOW_COPY_AND_ASSIGN(ChildProcessLauncher); | 78 DISALLOW_COPY_AND_ASSIGN(ChildProcessLauncher); |
| 76 }; | 79 }; |
| 77 | 80 |
| 78 } // namespace content | 81 } // namespace content |
| 79 | 82 |
| 80 #endif // CONTENT_BROWSER_CHILD_PROCESS_LAUNCHER_H_ | 83 #endif // CONTENT_BROWSER_CHILD_PROCESS_LAUNCHER_H_ |
| OLD | NEW |