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 #include "ipc/ipc_platform_file.h" | 5 #include "ipc/ipc_platform_file.h" |
6 | 6 |
7 #if defined(OS_POSIX) | 7 #if defined(OS_POSIX) |
8 #include <unistd.h> | 8 #include <unistd.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 27 matching lines...) Expand all Loading... |
38 // close the source handle before the message is sent, creating a race | 38 // close the source handle before the message is sent, creating a race |
39 // condition. | 39 // condition. |
40 int fd = close_source_handle ? handle : ::dup(handle); | 40 int fd = close_source_handle ? handle : ::dup(handle); |
41 out_handle = base::FileDescriptor(fd, true); | 41 out_handle = base::FileDescriptor(fd, true); |
42 #else | 42 #else |
43 #error Not implemented. | 43 #error Not implemented. |
44 #endif | 44 #endif |
45 return out_handle; | 45 return out_handle; |
46 } | 46 } |
47 | 47 |
| 48 PlatformFileForTransit TakeFileHandleForProcess(base::File file, |
| 49 base::ProcessHandle process) { |
| 50 return GetFileHandleForProcess(file.TakePlatformFile(), process, true); |
| 51 } |
| 52 |
48 } // namespace IPC | 53 } // namespace IPC |
OLD | NEW |