| 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_TESTS_COMMON_CONTROLLER_H_ | 5 #ifndef SANDBOX_WIN_TESTS_COMMON_CONTROLLER_H_ |
| 6 #define SANDBOX_WIN_TESTS_COMMON_CONTROLLER_H_ | 6 #define SANDBOX_WIN_TESTS_COMMON_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/memory/ref_counted.h" |
| 11 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
| 12 #include "base/win/scoped_handle.h" | 13 #include "base/win/scoped_handle.h" |
| 13 #include "sandbox/win/src/sandbox.h" | 14 #include "sandbox/win/src/sandbox.h" |
| 14 | 15 |
| 15 namespace sandbox { | 16 namespace sandbox { |
| 16 | 17 |
| 17 // See winerror.h for details. | 18 // See winerror.h for details. |
| 18 #define SEVERITY_INFO_FLAGS 0x40000000 | 19 #define SEVERITY_INFO_FLAGS 0x40000000 |
| 19 #define SEVERITY_ERROR_FLAGS 0xC0000000 | 20 #define SEVERITY_ERROR_FLAGS 0xC0000000 |
| 20 #define CUSTOMER_CODE 0x20000000 | 21 #define CUSTOMER_CODE 0x20000000 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 private: | 128 private: |
| 128 // Initializes the data in the object. Sets is_init_ to tree if the | 129 // Initializes the data in the object. Sets is_init_ to tree if the |
| 129 // function succeeds. This is meant to be called from the constructor. | 130 // function succeeds. This is meant to be called from the constructor. |
| 130 void Init(JobLevel job_level, TokenLevel startup_token, | 131 void Init(JobLevel job_level, TokenLevel startup_token, |
| 131 TokenLevel main_token); | 132 TokenLevel main_token); |
| 132 | 133 |
| 133 // The actual runner. | 134 // The actual runner. |
| 134 int InternalRunTest(const wchar_t* command); | 135 int InternalRunTest(const wchar_t* command); |
| 135 | 136 |
| 136 BrokerServices* broker_; | 137 BrokerServices* broker_; |
| 137 TargetPolicy* policy_; | 138 scoped_refptr<TargetPolicy> policy_; |
| 138 DWORD timeout_; | 139 DWORD timeout_; |
| 139 SboxTestsState state_; | 140 SboxTestsState state_; |
| 140 bool is_init_; | 141 bool is_init_; |
| 141 bool is_async_; | 142 bool is_async_; |
| 142 bool no_sandbox_; | 143 bool no_sandbox_; |
| 143 bool kill_on_destruction_; | 144 bool kill_on_destruction_; |
| 144 base::win::ScopedHandle target_process_; | 145 base::win::ScopedHandle target_process_; |
| 145 DWORD target_process_id_; | 146 DWORD target_process_id_; |
| 146 }; | 147 }; |
| 147 | 148 |
| 148 // Returns the broker services. | 149 // Returns the broker services. |
| 149 BrokerServices* GetBroker(); | 150 BrokerServices* GetBroker(); |
| 150 | 151 |
| 151 // Constructs a full path to a file inside the system32 (or syswow64) folder. | 152 // Constructs a full path to a file inside the system32 (or syswow64) folder. |
| 152 base::string16 MakePathToSys(const wchar_t* name, bool is_obj_man_path); | 153 base::string16 MakePathToSys(const wchar_t* name, bool is_obj_man_path); |
| 153 | 154 |
| 154 // Runs the given test on the target process. | 155 // Runs the given test on the target process. |
| 155 int DispatchCall(int argc, wchar_t **argv); | 156 int DispatchCall(int argc, wchar_t **argv); |
| 156 | 157 |
| 157 } // namespace sandbox | 158 } // namespace sandbox |
| 158 | 159 |
| 159 #endif // SANDBOX_WIN_TESTS_COMMON_CONTROLLER_H_ | 160 #endif // SANDBOX_WIN_TESTS_COMMON_CONTROLLER_H_ |
| OLD | NEW |