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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 // pathname was specified on the command line, that will be used. Otherwise, | 64 // pathname was specified on the command line, that will be used. Otherwise, |
65 // the default child process pathname will be returned. On most platforms, | 65 // the default child process pathname will be returned. On most platforms, |
66 // this will be the same as the currently-executing process. | 66 // this will be the same as the currently-executing process. |
67 // | 67 // |
68 // The |flags| argument accepts one or more flags such as CHILD_ALLOW_SELF. | 68 // The |flags| argument accepts one or more flags such as CHILD_ALLOW_SELF. |
69 // Pass only CHILD_NORMAL if none of these special behaviors are required. | 69 // Pass only CHILD_NORMAL if none of these special behaviors are required. |
70 // | 70 // |
71 // On failure, returns an empty FilePath. | 71 // On failure, returns an empty FilePath. |
72 static base::FilePath GetChildPath(int flags); | 72 static base::FilePath GetChildPath(int flags); |
73 | 73 |
74 // Returns an AttachmentBroker used to broker attachments of IPC messages to | |
75 // child processes. | |
76 static IPC::AttachmentBrokerPrivileged* GetAttachmentBroker(); | |
77 | |
78 // Send the shutdown message to the child process. | 74 // Send the shutdown message to the child process. |
79 // Does not check with the delegate's CanShutdown. | 75 // Does not check with the delegate's CanShutdown. |
80 virtual void ForceShutdown() = 0; | 76 virtual void ForceShutdown() = 0; |
81 | 77 |
82 // Creates the IPC channel. Returns the channel id if it succeeded, an | 78 // Creates the IPC channel. Returns the channel id if it succeeded, an |
83 // empty string otherwise | 79 // empty string otherwise |
84 virtual std::string CreateChannel() = 0; | 80 virtual std::string CreateChannel() = 0; |
85 | 81 |
86 // Returns true iff the IPC channel is currently being opened; | 82 // Returns true iff the IPC channel is currently being opened; |
87 virtual bool IsChannelOpening() = 0; | 83 virtual bool IsChannelOpening() = 0; |
88 | 84 |
89 // Adds an IPC message filter. A reference will be kept to the filter. | 85 // Adds an IPC message filter. A reference will be kept to the filter. |
90 virtual void AddFilter(IPC::MessageFilter* filter) = 0; | 86 virtual void AddFilter(IPC::MessageFilter* filter) = 0; |
91 | 87 |
92 #if defined(OS_POSIX) | 88 #if defined(OS_POSIX) |
93 // See IPC::Channel::TakeClientFileDescriptor. | 89 // See IPC::Channel::TakeClientFileDescriptor. |
94 virtual base::ScopedFD TakeClientFileDescriptor() = 0; | 90 virtual base::ScopedFD TakeClientFileDescriptor() = 0; |
95 #endif | 91 #endif |
96 }; | 92 }; |
97 | 93 |
98 }; // namespace content | 94 }; // namespace content |
99 | 95 |
100 #endif // CONTENT_PUBLIC_COMMON_CHILD_PROCESS_HOST_H_ | 96 #endif // CONTENT_PUBLIC_COMMON_CHILD_PROCESS_HOST_H_ |
OLD | NEW |