| 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 "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 #include "ipc/ipc_platform_file.h" | 6 #include "ipc/ipc_platform_file.h" |
| 7 | 7 |
| 8 #if defined(OS_POSIX) | 8 #if defined(OS_POSIX) |
| 9 #include <unistd.h> | 9 #include <unistd.h> |
| 10 #endif | 10 #endif |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 // the other process from the I/O thread. Without the dup, calling code might | 37 // the other process from the I/O thread. Without the dup, calling code might |
| 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 return base::FileDescriptor(fd, true); | 41 return base::FileDescriptor(fd, true); |
| 42 #else | 42 #else |
| 43 #error Not implemented. | 43 #error Not implemented. |
| 44 #endif | 44 #endif |
| 45 } | 45 } |
| 46 | 46 |
| 47 PlatformFileForTransit TakeFileHandleForProcess(base::File file, | 47 PlatformFileForTransit TakePlatformFileForTransit(base::File file) { |
| 48 base::ProcessHandle process) { | |
| 49 return GetPlatformFileForTransit(file.TakePlatformFile(), true); | 48 return GetPlatformFileForTransit(file.TakePlatformFile(), true); |
| 50 } | 49 } |
| 51 | 50 |
| 52 } // namespace IPC | 51 } // namespace IPC |
| OLD | NEW |