| 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 "sandbox/win/src/broker_services.h" | 5 #include "sandbox/win/src/broker_services.h" |
| 6 | 6 |
| 7 #include <AclAPI.h> | 7 #include <AclAPI.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 HANDLE stdout_handle = policy_base->GetStdoutHandle(); | 351 HANDLE stdout_handle = policy_base->GetStdoutHandle(); |
| 352 HANDLE stderr_handle = policy_base->GetStderrHandle(); | 352 HANDLE stderr_handle = policy_base->GetStderrHandle(); |
| 353 | 353 |
| 354 if (stdout_handle != INVALID_HANDLE_VALUE) | 354 if (stdout_handle != INVALID_HANDLE_VALUE) |
| 355 inherited_handle_list.push_back(stdout_handle); | 355 inherited_handle_list.push_back(stdout_handle); |
| 356 | 356 |
| 357 // Handles in the list must be unique. | 357 // Handles in the list must be unique. |
| 358 if (stderr_handle != stdout_handle && stderr_handle != INVALID_HANDLE_VALUE) | 358 if (stderr_handle != stdout_handle && stderr_handle != INVALID_HANDLE_VALUE) |
| 359 inherited_handle_list.push_back(stderr_handle); | 359 inherited_handle_list.push_back(stderr_handle); |
| 360 | 360 |
| 361 const base::HandlesToInheritVector& policy_handle_list = | 361 const auto& policy_handle_list = policy_base->GetHandlesBeingShared(); |
| 362 policy_base->GetHandlesBeingShared(); | |
| 363 | 362 |
| 364 for (HANDLE handle : policy_handle_list) | 363 for (HANDLE handle : policy_handle_list) |
| 365 inherited_handle_list.push_back(handle); | 364 inherited_handle_list.push_back(handle); |
| 366 | 365 |
| 367 if (inherited_handle_list.size()) | 366 if (inherited_handle_list.size()) |
| 368 ++attribute_count; | 367 ++attribute_count; |
| 369 | 368 |
| 370 if (!startup_info.InitializeProcThreadAttributeList(attribute_count)) | 369 if (!startup_info.InitializeProcThreadAttributeList(attribute_count)) |
| 371 return SBOX_ERROR_PROC_THREAD_ATTRIBUTES; | 370 return SBOX_ERROR_PROC_THREAD_ATTRIBUTES; |
| 372 | 371 |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 ::WaitForSingleObject(no_targets_.Get(), INFINITE); | 476 ::WaitForSingleObject(no_targets_.Get(), INFINITE); |
| 478 return SBOX_ALL_OK; | 477 return SBOX_ALL_OK; |
| 479 } | 478 } |
| 480 | 479 |
| 481 bool BrokerServicesBase::IsActiveTarget(DWORD process_id) { | 480 bool BrokerServicesBase::IsActiveTarget(DWORD process_id) { |
| 482 AutoLock lock(&lock_); | 481 AutoLock lock(&lock_); |
| 483 return child_process_ids_.find(process_id) != child_process_ids_.end(); | 482 return child_process_ids_.find(process_id) != child_process_ids_.end(); |
| 484 } | 483 } |
| 485 | 484 |
| 486 } // namespace sandbox | 485 } // namespace sandbox |
| OLD | NEW |