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/process_util.h" | 8 #include "base/process_util.h" |
9 #include "base/string16.h" | 9 #include "base/string16.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
11 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
12 #include "content/public/common/process_type.h" | 12 #include "content/public/common/process_type.h" |
13 #include "ipc/ipc_sender.h" | 13 #include "ipc/ipc_sender.h" |
14 | 14 |
15 class CommandLine; | 15 class CommandLine; |
| 16 |
| 17 namespace base { |
16 class FilePath; | 18 class FilePath; |
| 19 } |
17 | 20 |
18 namespace content { | 21 namespace content { |
19 | 22 |
20 class BrowserChildProcessHostDelegate; | 23 class BrowserChildProcessHostDelegate; |
21 class ChildProcessHost; | 24 class ChildProcessHost; |
22 struct ChildProcessData; | 25 struct ChildProcessData; |
23 | 26 |
24 // This represents child processes of the browser process, i.e. plugins. They | 27 // This represents child processes of the browser process, i.e. plugins. They |
25 // will get terminated at browser shutdown. | 28 // will get terminated at browser shutdown. |
26 class CONTENT_EXPORT BrowserChildProcessHost : public IPC::Sender { | 29 class CONTENT_EXPORT BrowserChildProcessHost : public IPC::Sender { |
27 public: | 30 public: |
28 // Used to create a child process host. The delegate must outlive this object. | 31 // Used to create a child process host. The delegate must outlive this object. |
29 static BrowserChildProcessHost* Create( | 32 static BrowserChildProcessHost* Create( |
30 ProcessType type, | 33 ProcessType type, |
31 BrowserChildProcessHostDelegate* delegate); | 34 BrowserChildProcessHostDelegate* delegate); |
32 | 35 |
33 virtual ~BrowserChildProcessHost() {} | 36 virtual ~BrowserChildProcessHost() {} |
34 | 37 |
35 // Derived classes call this to launch the child process asynchronously. | 38 // Derived classes call this to launch the child process asynchronously. |
36 // Takes ownership of |cmd_line|. | 39 // Takes ownership of |cmd_line|. |
37 virtual void Launch( | 40 virtual void Launch( |
38 #if defined(OS_WIN) | 41 #if defined(OS_WIN) |
39 const FilePath& exposed_dir, | 42 const base::FilePath& exposed_dir, |
40 #elif defined(OS_POSIX) | 43 #elif defined(OS_POSIX) |
41 bool use_zygote, | 44 bool use_zygote, |
42 const base::EnvironmentVector& environ, | 45 const base::EnvironmentVector& environ, |
43 #endif | 46 #endif |
44 CommandLine* cmd_line) = 0; | 47 CommandLine* cmd_line) = 0; |
45 | 48 |
46 virtual const ChildProcessData& GetData() const = 0; | 49 virtual const ChildProcessData& GetData() const = 0; |
47 | 50 |
48 // Returns the ChildProcessHost object used by this object. | 51 // Returns the ChildProcessHost object used by this object. |
49 virtual ChildProcessHost* GetHost() const = 0; | 52 virtual ChildProcessHost* GetHost() const = 0; |
(...skipping 16 matching lines...) Expand all Loading... |
66 | 69 |
67 #if defined(OS_MACOSX) && !defined(OS_IOS) | 70 #if defined(OS_MACOSX) && !defined(OS_IOS) |
68 // Returns a PortProvider used to get process metrics for child processes. | 71 // Returns a PortProvider used to get process metrics for child processes. |
69 static base::ProcessMetrics::PortProvider* GetPortProvider(); | 72 static base::ProcessMetrics::PortProvider* GetPortProvider(); |
70 #endif | 73 #endif |
71 }; | 74 }; |
72 | 75 |
73 }; // namespace content | 76 }; // namespace content |
74 | 77 |
75 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CHILD_PROCESS_HOST_H_ | 78 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CHILD_PROCESS_HOST_H_ |
OLD | NEW |