| 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" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 // the default child process pathname will be returned. On most platforms, | 82 // the default child process pathname will be returned. On most platforms, |
| 83 // this will be the same as the currently-executing process. | 83 // this will be the same as the currently-executing process. |
| 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 | |
| 93 // child processes. | |
| 94 static IPC::AttachmentBrokerPrivileged* GetAttachmentBroker(); | |
| 95 | |
| 96 // Send the shutdown message to the child process. | 92 // Send the shutdown message to the child process. |
| 97 // Does not check with the delegate's CanShutdown. | 93 // Does not check with the delegate's CanShutdown. |
| 98 virtual void ForceShutdown() = 0; | 94 virtual void ForceShutdown() = 0; |
| 99 | 95 |
| 100 // Creates the IPC channel. Returns the channel id if it succeeded, an | 96 // Creates the IPC channel. Returns the channel id if it succeeded, an |
| 101 // empty string otherwise | 97 // empty string otherwise |
| 102 virtual std::string CreateChannel() = 0; | 98 virtual std::string CreateChannel() = 0; |
| 103 | 99 |
| 104 // Returns true iff the IPC channel is currently being opened; | 100 // Returns true iff the IPC channel is currently being opened; |
| 105 virtual bool IsChannelOpening() = 0; | 101 virtual bool IsChannelOpening() = 0; |
| 106 | 102 |
| 107 // Adds an IPC message filter. A reference will be kept to the filter. | 103 // Adds an IPC message filter. A reference will be kept to the filter. |
| 108 virtual void AddFilter(IPC::MessageFilter* filter) = 0; | 104 virtual void AddFilter(IPC::MessageFilter* filter) = 0; |
| 109 | 105 |
| 110 #if defined(OS_POSIX) | 106 #if defined(OS_POSIX) |
| 111 // See IPC::Channel::TakeClientFileDescriptor. | 107 // See IPC::Channel::TakeClientFileDescriptor. |
| 112 virtual base::ScopedFD TakeClientFileDescriptor() = 0; | 108 virtual base::ScopedFD TakeClientFileDescriptor() = 0; |
| 113 #endif | 109 #endif |
| 114 }; | 110 }; |
| 115 | 111 |
| 116 }; // namespace content | 112 }; // namespace content |
| 117 | 113 |
| 118 #endif // CONTENT_PUBLIC_COMMON_CHILD_PROCESS_HOST_H_ | 114 #endif // CONTENT_PUBLIC_COMMON_CHILD_PROCESS_HOST_H_ |
| OLD | NEW |