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/public/common/sandbox_init.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "content/common/sandbox_win.h" | 9 #include "content/common/sandbox_win.h" |
10 #include "content/public/common/content_switches.h" | 10 #include "content/public/common/content_switches.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 | 40 |
41 sandbox::TargetServices* target_services = sandbox_info->target_services; | 41 sandbox::TargetServices* target_services = sandbox_info->target_services; |
42 return InitTargetServices(target_services); | 42 return InitTargetServices(target_services); |
43 } | 43 } |
44 | 44 |
45 bool BrokerDuplicateSharedMemoryHandle( | 45 bool BrokerDuplicateSharedMemoryHandle( |
46 const base::SharedMemoryHandle& source_handle, | 46 const base::SharedMemoryHandle& source_handle, |
47 base::ProcessId target_process_id, | 47 base::ProcessId target_process_id, |
48 base::SharedMemoryHandle* target_handle) { | 48 base::SharedMemoryHandle* target_handle) { |
49 HANDLE duped_handle; | 49 HANDLE duped_handle; |
50 if (!BrokerDuplicateHandle(source_handle.GetHandle(), target_process_id, | 50 if (!BrokerDuplicateHandle( |
51 &duped_handle, | 51 source_handle.GetHandle(), target_process_id, &duped_handle, |
52 FILE_GENERIC_READ | FILE_GENERIC_WRITE, 0)) { | 52 FILE_MAP_READ | FILE_MAP_WRITE | SECTION_QUERY, 0)) { |
53 return false; | 53 return false; |
54 } | 54 } |
55 | 55 |
56 *target_handle = base::SharedMemoryHandle(duped_handle, target_process_id); | 56 *target_handle = base::SharedMemoryHandle(duped_handle, target_process_id); |
57 return true; | 57 return true; |
58 } | 58 } |
59 | 59 |
60 } // namespace content | 60 } // namespace content |
OLD | NEW |