Chromium Code Reviews| 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/process/kill.h" | 10 #include "base/process/kill.h" |
| 10 #include "base/process/process_handle.h" | 11 #include "base/process/process_handle.h" |
| 11 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
| 12 #include "build/build_config.h" | 13 #include "build/build_config.h" |
| 13 #include "content/common/content_export.h" | 14 #include "content/common/content_export.h" |
| 14 #include "content/public/common/process_type.h" | 15 #include "content/public/common/process_type.h" |
| 15 #include "ipc/ipc_sender.h" | 16 #include "ipc/ipc_sender.h" |
| 16 | 17 |
| 17 #if defined(OS_MACOSX) | 18 #if defined(OS_MACOSX) |
| 18 #include "base/process/port_provider_mac.h" | 19 #include "base/process/port_provider_mac.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 55 const std::string& service_name); | 56 const std::string& service_name); |
| 56 | 57 |
| 57 // Returns the child process host with unique id |child_process_id|, or | 58 // Returns the child process host with unique id |child_process_id|, or |
| 58 // nullptr if it doesn't exist. |child_process_id| is NOT the process ID, but | 59 // nullptr if it doesn't exist. |child_process_id| is NOT the process ID, but |
| 59 // is the same unique ID as |ChildProcessData::id|. | 60 // is the same unique ID as |ChildProcessData::id|. |
| 60 static BrowserChildProcessHost* FromID(int child_process_id); | 61 static BrowserChildProcessHost* FromID(int child_process_id); |
| 61 | 62 |
| 62 ~BrowserChildProcessHost() override {} | 63 ~BrowserChildProcessHost() override {} |
| 63 | 64 |
| 64 // Derived classes call this to launch the child process asynchronously. | 65 // Derived classes call this to launch the child process asynchronously. |
| 65 // Takes ownership of |cmd_line| and |delegate|. | 66 // Takes ownership of |cmd_line| and |delegate|. |
|
Alexei Svitkine (slow)
2016/10/04 18:49:36
Document the new param.
lawrencewu
2016/10/05 20:57:56
Done.
| |
| 66 virtual void Launch( | 67 virtual void Launch(SandboxedProcessLauncherDelegate* delegate, |
| 67 SandboxedProcessLauncherDelegate* delegate, | 68 base::CommandLine* cmd_line, |
| 68 base::CommandLine* cmd_line, | 69 const base::SharedMemory* field_trial_state, |
| 69 bool terminate_on_shutdown) = 0; | 70 bool terminate_on_shutdown) = 0; |
| 70 | 71 |
| 71 virtual const ChildProcessData& GetData() const = 0; | 72 virtual const ChildProcessData& GetData() const = 0; |
| 72 | 73 |
| 73 // Returns the ChildProcessHost object used by this object. | 74 // Returns the ChildProcessHost object used by this object. |
| 74 virtual ChildProcessHost* GetHost() const = 0; | 75 virtual ChildProcessHost* GetHost() const = 0; |
| 75 | 76 |
| 76 // Returns the termination status of a child. |exit_code| is the | 77 // Returns the termination status of a child. |exit_code| is the |
| 77 // status returned when the process exited (for posix, as returned | 78 // status returned when the process exited (for posix, as returned |
| 78 // from waitpid(), for Windows, as returned from | 79 // from waitpid(), for Windows, as returned from |
| 79 // GetExitCodeProcess()). |exit_code| may be nullptr. | 80 // GetExitCodeProcess()). |exit_code| may be nullptr. |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 99 | 100 |
| 100 #if defined(OS_MACOSX) | 101 #if defined(OS_MACOSX) |
| 101 // Returns a PortProvider used to get the task port for child processes. | 102 // Returns a PortProvider used to get the task port for child processes. |
| 102 static base::PortProvider* GetPortProvider(); | 103 static base::PortProvider* GetPortProvider(); |
| 103 #endif | 104 #endif |
| 104 }; | 105 }; |
| 105 | 106 |
| 106 }; // namespace content | 107 }; // namespace content |
| 107 | 108 |
| 108 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CHILD_PROCESS_HOST_H_ | 109 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CHILD_PROCESS_HOST_H_ |
| OLD | NEW |