| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/files/scoped_file.h" | 10 #include "base/files/scoped_file.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 // The |flags| argument accepts one or more flags such as CHILD_ALLOW_SELF. | 70 // The |flags| argument accepts one or more flags such as CHILD_ALLOW_SELF. |
| 71 // Pass only CHILD_NORMAL if none of these special behaviors are required. | 71 // Pass only CHILD_NORMAL if none of these special behaviors are required. |
| 72 // | 72 // |
| 73 // On failure, returns an empty FilePath. | 73 // On failure, returns an empty FilePath. |
| 74 static base::FilePath GetChildPath(int flags); | 74 static base::FilePath GetChildPath(int flags); |
| 75 | 75 |
| 76 // Send the shutdown message to the child process. | 76 // Send the shutdown message to the child process. |
| 77 // Does not check with the delegate's CanShutdown. | 77 // Does not check with the delegate's CanShutdown. |
| 78 virtual void ForceShutdown() = 0; | 78 virtual void ForceShutdown() = 0; |
| 79 | 79 |
| 80 // Returns true if a shutdown message has been sent to the child process. |
| 81 virtual bool IsShuttingDown() = 0; |
| 82 |
| 80 // Creates the IPC channel. Returns the channel id if it succeeded, an | 83 // Creates the IPC channel. Returns the channel id if it succeeded, an |
| 81 // empty string otherwise | 84 // empty string otherwise |
| 82 virtual std::string CreateChannel() = 0; | 85 virtual std::string CreateChannel() = 0; |
| 83 | 86 |
| 84 // Creates the IPC channel on top of Mojo. Returns the Mojo channel token if | 87 // Creates the IPC channel on top of Mojo. Returns the Mojo channel token if |
| 85 // succeeded, or an empty string on failure. | 88 // succeeded, or an empty string on failure. |
| 86 virtual std::string CreateChannelMojo(const std::string& child_token) = 0; | 89 virtual std::string CreateChannelMojo(const std::string& child_token) = 0; |
| 87 | 90 |
| 88 // Returns true iff the IPC channel is currently being opened; | 91 // Returns true iff the IPC channel is currently being opened; |
| 89 virtual bool IsChannelOpening() = 0; | 92 virtual bool IsChannelOpening() = 0; |
| 90 | 93 |
| 91 // Adds an IPC message filter. A reference will be kept to the filter. | 94 // Adds an IPC message filter. A reference will be kept to the filter. |
| 92 virtual void AddFilter(IPC::MessageFilter* filter) = 0; | 95 virtual void AddFilter(IPC::MessageFilter* filter) = 0; |
| 93 | 96 |
| 94 #if defined(OS_POSIX) | 97 #if defined(OS_POSIX) |
| 95 // See IPC::Channel::TakeClientFileDescriptor. | 98 // See IPC::Channel::TakeClientFileDescriptor. |
| 96 virtual base::ScopedFD TakeClientFileDescriptor() = 0; | 99 virtual base::ScopedFD TakeClientFileDescriptor() = 0; |
| 97 #endif | 100 #endif |
| 98 }; | 101 }; |
| 99 | 102 |
| 100 }; // namespace content | 103 }; // namespace content |
| 101 | 104 |
| 102 #endif // CONTENT_PUBLIC_COMMON_CHILD_PROCESS_HOST_H_ | 105 #endif // CONTENT_PUBLIC_COMMON_CHILD_PROCESS_HOST_H_ |
| OLD | NEW |