OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 IPC_IPC_PLATFORM_FILE_H_ | 5 #ifndef IPC_IPC_PLATFORM_FILE_H_ |
6 #define IPC_IPC_PLATFORM_FILE_H_ | 6 #define IPC_IPC_PLATFORM_FILE_H_ |
7 | 7 |
8 #include "base/files/file.h" | 8 #include "base/files/file.h" |
9 #include "base/process/process.h" | 9 #include "base/process/process.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 return base::File(transit.fd); | 54 return base::File(transit.fd); |
55 #endif | 55 #endif |
56 } | 56 } |
57 | 57 |
58 // Creates a new handle that can be passed through IPC. The result must be | 58 // Creates a new handle that can be passed through IPC. The result must be |
59 // passed to the IPC layer as part of a message, or else it will leak. | 59 // passed to the IPC layer as part of a message, or else it will leak. |
60 IPC_EXPORT PlatformFileForTransit GetPlatformFileForTransit( | 60 IPC_EXPORT PlatformFileForTransit GetPlatformFileForTransit( |
61 base::PlatformFile file, | 61 base::PlatformFile file, |
62 bool close_source_handle); | 62 bool close_source_handle); |
63 | 63 |
64 // Returns a file handle equivalent to |file| that can be used in |process|. | 64 // Creates a new handle that can be passed through IPC. The result must be |
| 65 // passed to the IPC layer as part of a message, or else it will leak. |
65 // Note that this function takes ownership of |file|. | 66 // Note that this function takes ownership of |file|. |
66 IPC_EXPORT PlatformFileForTransit TakeFileHandleForProcess( | 67 IPC_EXPORT PlatformFileForTransit TakePlatformFileForTransit(base::File file); |
67 base::File file, | |
68 base::ProcessHandle process); | |
69 | 68 |
70 } // namespace IPC | 69 } // namespace IPC |
71 | 70 |
72 #endif // IPC_IPC_PLATFORM_FILE_H_ | 71 #endif // IPC_IPC_PLATFORM_FILE_H_ |
OLD | NEW |