| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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|. |
| 66 virtual void Launch( | 67 virtual void Launch( |
| 67 SandboxedProcessLauncherDelegate* delegate, | 68 SandboxedProcessLauncherDelegate* delegate, |
| 69 base::SharedMemory* field_trial_state, |
| 68 base::CommandLine* cmd_line, | 70 base::CommandLine* cmd_line, |
| 69 bool terminate_on_shutdown) = 0; | 71 bool terminate_on_shutdown) = 0; |
| 70 | 72 |
| 71 virtual const ChildProcessData& GetData() const = 0; | 73 virtual const ChildProcessData& GetData() const = 0; |
| 72 | 74 |
| 73 // Returns the ChildProcessHost object used by this object. | 75 // Returns the ChildProcessHost object used by this object. |
| 74 virtual ChildProcessHost* GetHost() const = 0; | 76 virtual ChildProcessHost* GetHost() const = 0; |
| 75 | 77 |
| 76 // Returns the termination status of a child. |exit_code| is the | 78 // Returns the termination status of a child. |exit_code| is the |
| 77 // status returned when the process exited (for posix, as returned | 79 // status returned when the process exited (for posix, as returned |
| (...skipping 21 matching lines...) Expand all Loading... |
| 99 | 101 |
| 100 #if defined(OS_MACOSX) | 102 #if defined(OS_MACOSX) |
| 101 // Returns a PortProvider used to get the task port for child processes. | 103 // Returns a PortProvider used to get the task port for child processes. |
| 102 static base::PortProvider* GetPortProvider(); | 104 static base::PortProvider* GetPortProvider(); |
| 103 #endif | 105 #endif |
| 104 }; | 106 }; |
| 105 | 107 |
| 106 }; // namespace content | 108 }; // namespace content |
| 107 | 109 |
| 108 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CHILD_PROCESS_HOST_H_ | 110 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CHILD_PROCESS_HOST_H_ |
| OLD | NEW |