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 "content/public/common/sandbox_init.h" | 5 #include "content/common/sandbox_util.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 |
| 11 #include "content/public/common/sandbox_init.h" |
| 12 |
11 namespace content { | 13 namespace content { |
12 | 14 |
13 IPC::PlatformFileForTransit BrokerGetFileHandleForProcess( | 15 IPC::PlatformFileForTransit BrokerGetFileHandleForProcess( |
14 base::PlatformFile handle, | 16 base::PlatformFile handle, |
15 base::ProcessId target_process_id, | 17 base::ProcessId target_process_id, |
16 bool should_close_source) { | 18 bool should_close_source) { |
17 IPC::PlatformFileForTransit out_handle; | 19 IPC::PlatformFileForTransit out_handle; |
18 #if defined(OS_WIN) | 20 #if defined(OS_WIN) |
19 DWORD options = DUPLICATE_SAME_ACCESS; | 21 DWORD options = DUPLICATE_SAME_ACCESS; |
20 if (should_close_source) | 22 if (should_close_source) |
(...skipping 14 matching lines...) Expand all Loading... |
35 int fd = should_close_source ? handle : ::dup(handle); | 37 int fd = should_close_source ? handle : ::dup(handle); |
36 out_handle = base::FileDescriptor(fd, true); | 38 out_handle = base::FileDescriptor(fd, true); |
37 #else | 39 #else |
38 #error Not implemented. | 40 #error Not implemented. |
39 #endif | 41 #endif |
40 return out_handle; | 42 return out_handle; |
41 } | 43 } |
42 | 44 |
43 } // namespace content | 45 } // namespace content |
44 | 46 |
OLD | NEW |