| 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 #ifndef SANDBOX_WIN_SRC_TARGET_PROCESS_H_ | 5 #ifndef SANDBOX_WIN_SRC_TARGET_PROCESS_H_ |
| 6 #define SANDBOX_WIN_SRC_TARGET_PROCESS_H_ | 6 #define SANDBOX_WIN_SRC_TARGET_PROCESS_H_ |
| 7 | 7 |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 #include <stdint.h> | 10 #include <stdint.h> |
| 11 | 11 |
| 12 #include <memory> |
| 13 |
| 12 #include "base/macros.h" | 14 #include "base/macros.h" |
| 13 #include "base/memory/free_deleter.h" | 15 #include "base/memory/free_deleter.h" |
| 14 #include "base/memory/scoped_ptr.h" | |
| 15 #include "base/win/scoped_handle.h" | 16 #include "base/win/scoped_handle.h" |
| 16 #include "base/win/scoped_process_information.h" | 17 #include "base/win/scoped_process_information.h" |
| 17 #include "sandbox/win/src/crosscall_server.h" | 18 #include "sandbox/win/src/crosscall_server.h" |
| 18 #include "sandbox/win/src/sandbox_types.h" | 19 #include "sandbox/win/src/sandbox_types.h" |
| 19 | 20 |
| 20 namespace base { | 21 namespace base { |
| 21 namespace win { | 22 namespace win { |
| 22 | 23 |
| 23 class StartupInformation; | 24 class StartupInformation; |
| 24 | 25 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 // start. It has more powers than the lockdown_token. | 113 // start. It has more powers than the lockdown_token. |
| 113 base::win::ScopedHandle initial_token_; | 114 base::win::ScopedHandle initial_token_; |
| 114 // The lowbox token associated with the process. This token is set after the | 115 // The lowbox token associated with the process. This token is set after the |
| 115 // process creation. | 116 // process creation. |
| 116 base::win::ScopedHandle lowbox_token_; | 117 base::win::ScopedHandle lowbox_token_; |
| 117 // Kernel handle to the shared memory used by the IPC server. | 118 // Kernel handle to the shared memory used by the IPC server. |
| 118 base::win::ScopedHandle shared_section_; | 119 base::win::ScopedHandle shared_section_; |
| 119 // Job object containing the target process. | 120 // Job object containing the target process. |
| 120 HANDLE job_; | 121 HANDLE job_; |
| 121 // Reference to the IPC subsystem. | 122 // Reference to the IPC subsystem. |
| 122 scoped_ptr<SharedMemIPCServer> ipc_server_; | 123 std::unique_ptr<SharedMemIPCServer> ipc_server_; |
| 123 // Provides the threads used by the IPC. This class does not own this pointer. | 124 // Provides the threads used by the IPC. This class does not own this pointer. |
| 124 ThreadProvider* thread_pool_; | 125 ThreadProvider* thread_pool_; |
| 125 // Base address of the main executable | 126 // Base address of the main executable |
| 126 void* base_address_; | 127 void* base_address_; |
| 127 // Full name of the target executable. | 128 // Full name of the target executable. |
| 128 scoped_ptr<wchar_t, base::FreeDeleter> exe_name_; | 129 std::unique_ptr<wchar_t, base::FreeDeleter> exe_name_; |
| 129 | 130 |
| 130 // Function used for testing. | 131 // Function used for testing. |
| 131 friend TargetProcess* MakeTestTargetProcess(HANDLE process, | 132 friend TargetProcess* MakeTestTargetProcess(HANDLE process, |
| 132 HMODULE base_address); | 133 HMODULE base_address); |
| 133 | 134 |
| 134 DISALLOW_IMPLICIT_CONSTRUCTORS(TargetProcess); | 135 DISALLOW_IMPLICIT_CONSTRUCTORS(TargetProcess); |
| 135 }; | 136 }; |
| 136 | 137 |
| 137 // Creates a mock TargetProcess used for testing interceptions. | 138 // Creates a mock TargetProcess used for testing interceptions. |
| 138 // TODO(cpu): It seems that this method is not going to be used anymore. | 139 // TODO(cpu): It seems that this method is not going to be used anymore. |
| 139 TargetProcess* MakeTestTargetProcess(HANDLE process, HMODULE base_address); | 140 TargetProcess* MakeTestTargetProcess(HANDLE process, HMODULE base_address); |
| 140 | 141 |
| 141 | 142 |
| 142 } // namespace sandbox | 143 } // namespace sandbox |
| 143 | 144 |
| 144 #endif // SANDBOX_WIN_SRC_TARGET_PROCESS_H_ | 145 #endif // SANDBOX_WIN_SRC_TARGET_PROCESS_H_ |
| OLD | NEW |