| 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_COMMON_CHILD_PROCESS_HOST_H_ | 5 #ifndef CONTENT_PUBLIC_COMMON_CHILD_PROCESS_HOST_H_ |
| 6 #define CONTENT_PUBLIC_COMMON_CHILD_PROCESS_HOST_H_ | 6 #define CONTENT_PUBLIC_COMMON_CHILD_PROCESS_HOST_H_ |
| 7 | 7 |
| 8 #include "base/files/scoped_file.h" | 8 #include "base/files/scoped_file.h" |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
| 11 #include "ipc/attachment_broker_privileged.h" |
| 11 #include "ipc/ipc_channel_proxy.h" | 12 #include "ipc/ipc_channel_proxy.h" |
| 12 | 13 |
| 13 namespace base { | 14 namespace base { |
| 14 class FilePath; | 15 class FilePath; |
| 15 } | 16 } |
| 16 | 17 |
| 17 namespace IPC { | 18 namespace IPC { |
| 18 class AttachmentBroker; | |
| 19 class MessageFilter; | 19 class MessageFilter; |
| 20 } | 20 } |
| 21 | 21 |
| 22 namespace content { | 22 namespace content { |
| 23 | 23 |
| 24 class ChildProcessHostDelegate; | 24 class ChildProcessHostDelegate; |
| 25 | 25 |
| 26 // This represents a non-browser process. This can include traditional child | 26 // This represents a non-browser process. This can include traditional child |
| 27 // processes like plugins, or an embedder could even use this for long lived | 27 // processes like plugins, or an embedder could even use this for long lived |
| 28 // processes that run independent of the browser process. | 28 // processes that run independent of the browser process. |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 // | 84 // |
| 85 // The |flags| argument accepts one or more flags such as CHILD_ALLOW_SELF | 85 // The |flags| argument accepts one or more flags such as CHILD_ALLOW_SELF |
| 86 // and CHILD_ALLOW_HEAP_EXECUTION as defined above. Pass only CHILD_NORMAL | 86 // and CHILD_ALLOW_HEAP_EXECUTION as defined above. Pass only CHILD_NORMAL |
| 87 // if none of these special behaviors are required. | 87 // if none of these special behaviors are required. |
| 88 // | 88 // |
| 89 // On failure, returns an empty FilePath. | 89 // On failure, returns an empty FilePath. |
| 90 static base::FilePath GetChildPath(int flags); | 90 static base::FilePath GetChildPath(int flags); |
| 91 | 91 |
| 92 // Returns an AttachmentBroker used to broker attachments of IPC messages to | 92 // Returns an AttachmentBroker used to broker attachments of IPC messages to |
| 93 // child processes. | 93 // child processes. |
| 94 static IPC::AttachmentBroker* GetAttachmentBroker(); | 94 static IPC::AttachmentBrokerPrivileged* GetAttachmentBroker(); |
| 95 | 95 |
| 96 // Send the shutdown message to the child process. | 96 // Send the shutdown message to the child process. |
| 97 // Does not check with the delegate's CanShutdown. | 97 // Does not check with the delegate's CanShutdown. |
| 98 virtual void ForceShutdown() = 0; | 98 virtual void ForceShutdown() = 0; |
| 99 | 99 |
| 100 // Creates the IPC channel. Returns the channel id if it succeeded, an | 100 // Creates the IPC channel. Returns the channel id if it succeeded, an |
| 101 // empty string otherwise | 101 // empty string otherwise |
| 102 virtual std::string CreateChannel() = 0; | 102 virtual std::string CreateChannel() = 0; |
| 103 | 103 |
| 104 // Returns true iff the IPC channel is currently being opened; | 104 // Returns true iff the IPC channel is currently being opened; |
| 105 virtual bool IsChannelOpening() = 0; | 105 virtual bool IsChannelOpening() = 0; |
| 106 | 106 |
| 107 // Adds an IPC message filter. A reference will be kept to the filter. | 107 // Adds an IPC message filter. A reference will be kept to the filter. |
| 108 virtual void AddFilter(IPC::MessageFilter* filter) = 0; | 108 virtual void AddFilter(IPC::MessageFilter* filter) = 0; |
| 109 | 109 |
| 110 #if defined(OS_POSIX) | 110 #if defined(OS_POSIX) |
| 111 // See IPC::Channel::TakeClientFileDescriptor. | 111 // See IPC::Channel::TakeClientFileDescriptor. |
| 112 virtual base::ScopedFD TakeClientFileDescriptor() = 0; | 112 virtual base::ScopedFD TakeClientFileDescriptor() = 0; |
| 113 #endif | 113 #endif |
| 114 }; | 114 }; |
| 115 | 115 |
| 116 }; // namespace content | 116 }; // namespace content |
| 117 | 117 |
| 118 #endif // CONTENT_PUBLIC_COMMON_CHILD_PROCESS_HOST_H_ | 118 #endif // CONTENT_PUBLIC_COMMON_CHILD_PROCESS_HOST_H_ |
| OLD | NEW |