| 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/common/sandbox_win.h" | 5 #include "content/common/sandbox_win.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/base_switches.h" | 9 #include "base/base_switches.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 return false; | 359 return false; |
| 360 #endif | 360 #endif |
| 361 | 361 |
| 362 #if defined(SANITIZER_COVERAGE) | 362 #if defined(SANITIZER_COVERAGE) |
| 363 DWORD coverage_dir_size = | 363 DWORD coverage_dir_size = |
| 364 ::GetEnvironmentVariable(L"SANITIZER_COVERAGE_DIR", NULL, 0); | 364 ::GetEnvironmentVariable(L"SANITIZER_COVERAGE_DIR", NULL, 0); |
| 365 if (coverage_dir_size == 0) { | 365 if (coverage_dir_size == 0) { |
| 366 LOG(WARNING) << "SANITIZER_COVERAGE_DIR was not set, coverage won't work."; | 366 LOG(WARNING) << "SANITIZER_COVERAGE_DIR was not set, coverage won't work."; |
| 367 } else { | 367 } else { |
| 368 std::wstring coverage_dir; | 368 std::wstring coverage_dir; |
| 369 wchar_t* coverage_dir_str = WriteInto(&coverage_dir, coverage_dir_size); | 369 wchar_t* coverage_dir_str = |
| 370 base::WriteInto(&coverage_dir, coverage_dir_size); |
| 370 coverage_dir_size = ::GetEnvironmentVariable( | 371 coverage_dir_size = ::GetEnvironmentVariable( |
| 371 L"SANITIZER_COVERAGE_DIR", coverage_dir_str, coverage_dir_size); | 372 L"SANITIZER_COVERAGE_DIR", coverage_dir_str, coverage_dir_size); |
| 372 CHECK(coverage_dir.size() == coverage_dir_size); | 373 CHECK(coverage_dir.size() == coverage_dir_size); |
| 373 base::FilePath sancov_path = | 374 base::FilePath sancov_path = |
| 374 base::FilePath(coverage_dir).Append(L"*.sancov"); | 375 base::FilePath(coverage_dir).Append(L"*.sancov"); |
| 375 result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_FILES, | 376 result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_FILES, |
| 376 sandbox::TargetPolicy::FILES_ALLOW_ANY, | 377 sandbox::TargetPolicy::FILES_ALLOW_ANY, |
| 377 sancov_path.value().c_str()); | 378 sancov_path.value().c_str()); |
| 378 if (result != sandbox::SBOX_ALL_OK) | 379 if (result != sandbox::SBOX_ALL_OK) |
| 379 return false; | 380 return false; |
| (...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 844 } | 845 } |
| 845 | 846 |
| 846 return false; | 847 return false; |
| 847 } | 848 } |
| 848 | 849 |
| 849 bool BrokerAddTargetPeer(HANDLE peer_process) { | 850 bool BrokerAddTargetPeer(HANDLE peer_process) { |
| 850 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK; | 851 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK; |
| 851 } | 852 } |
| 852 | 853 |
| 853 } // namespace content | 854 } // namespace content |
| OLD | NEW |