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_PULIC_COMMON_CHILD_PROCESS_HOST_H_ | 5 #ifndef CONTENT_PULIC_COMMON_CHILD_PROCESS_HOST_H_ |
6 #define CONTENT_PULIC_COMMON_CHILD_PROCESS_HOST_H_ | 6 #define CONTENT_PULIC_COMMON_CHILD_PROCESS_HOST_H_ |
7 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
10 #include "ipc/ipc_channel_proxy.h" | 10 #include "ipc/ipc_channel_proxy.h" |
11 | 11 |
| 12 namespace base { |
12 class FilePath; | 13 class FilePath; |
| 14 } |
13 | 15 |
14 namespace content { | 16 namespace content { |
15 | 17 |
16 class ChildProcessHostDelegate; | 18 class ChildProcessHostDelegate; |
17 | 19 |
18 // This represents a non-browser process. This can include traditional child | 20 // This represents a non-browser process. This can include traditional child |
19 // processes like plugins, or an embedder could even use this for long lived | 21 // processes like plugins, or an embedder could even use this for long lived |
20 // processes that run independent of the browser process. | 22 // processes that run independent of the browser process. |
21 class CONTENT_EXPORT ChildProcessHost : public IPC::Sender { | 23 class CONTENT_EXPORT ChildProcessHost : public IPC::Sender { |
22 public: | 24 public: |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 // Returns the pathname to be used for a child process. If a subprocess | 66 // Returns the pathname to be used for a child process. If a subprocess |
65 // pathname was specified on the command line, that will be used. Otherwise, | 67 // pathname was specified on the command line, that will be used. Otherwise, |
66 // the default child process pathname will be returned. On most platforms, | 68 // the default child process pathname will be returned. On most platforms, |
67 // this will be the same as the currently-executing process. | 69 // this will be the same as the currently-executing process. |
68 // | 70 // |
69 // The |flags| argument accepts one or more flags such as CHILD_ALLOW_SELF | 71 // The |flags| argument accepts one or more flags such as CHILD_ALLOW_SELF |
70 // and CHILD_ALLOW_HEAP_EXECUTION as defined above. Pass only CHILD_NORMAL | 72 // and CHILD_ALLOW_HEAP_EXECUTION as defined above. Pass only CHILD_NORMAL |
71 // if none of these special behaviors are required. | 73 // if none of these special behaviors are required. |
72 // | 74 // |
73 // On failure, returns an empty FilePath. | 75 // On failure, returns an empty FilePath. |
74 static FilePath GetChildPath(int flags); | 76 static base::FilePath GetChildPath(int flags); |
75 | 77 |
76 // Send the shutdown message to the child process. | 78 // Send the shutdown message to the child process. |
77 // Does not check with the delegate's CanShutdown. | 79 // Does not check with the delegate's CanShutdown. |
78 virtual void ForceShutdown() = 0; | 80 virtual void ForceShutdown() = 0; |
79 | 81 |
80 // Creates the IPC channel. Returns the channel id if it succeeded, an | 82 // Creates the IPC channel. Returns the channel id if it succeeded, an |
81 // empty string otherwise | 83 // empty string otherwise |
82 virtual std::string CreateChannel() = 0; | 84 virtual std::string CreateChannel() = 0; |
83 | 85 |
84 // Returns true iff the IPC channel is currently being opened; | 86 // Returns true iff the IPC channel is currently being opened; |
85 virtual bool IsChannelOpening() = 0; | 87 virtual bool IsChannelOpening() = 0; |
86 | 88 |
87 // Adds an IPC message filter. A reference will be kept to the filter. | 89 // Adds an IPC message filter. A reference will be kept to the filter. |
88 virtual void AddFilter(IPC::ChannelProxy::MessageFilter* filter) = 0; | 90 virtual void AddFilter(IPC::ChannelProxy::MessageFilter* filter) = 0; |
89 | 91 |
90 #if defined(OS_POSIX) | 92 #if defined(OS_POSIX) |
91 // See IPC::Channel::TakeClientFileDescriptor. | 93 // See IPC::Channel::TakeClientFileDescriptor. |
92 virtual int TakeClientFileDescriptor() = 0; | 94 virtual int TakeClientFileDescriptor() = 0; |
93 #endif | 95 #endif |
94 }; | 96 }; |
95 | 97 |
96 }; // namespace content | 98 }; // namespace content |
97 | 99 |
98 #endif // CONTENT_PULIC_COMMON_CHILD_PROCESS_HOST_H_ | 100 #endif // CONTENT_PULIC_COMMON_CHILD_PROCESS_HOST_H_ |
OLD | NEW |