Chromium Code Reviews| Index: content/common/sandbox_win.cc |
| diff --git a/content/common/sandbox_win.cc b/content/common/sandbox_win.cc |
| index 915f145d0ff74500ab39c449e54f558985beb652..08f5dd91eb962afce5e995ae7bc5d81ad2921245 100644 |
| --- a/content/common/sandbox_win.cc |
| +++ b/content/common/sandbox_win.cc |
| @@ -359,6 +359,26 @@ bool AddGenericPolicy(sandbox::TargetPolicy* policy) { |
| return false; |
| #endif |
| +#if defined(SANITIZER_COVERAGE) |
| + DWORD coverage_dir_size = |
| + ::GetEnvironmentVariable(L"SANITIZER_COVERAGE_DIR", NULL, 0); |
| + if (coverage_dir_size == 0) { |
| + LOG(WARNING) << "SANITIZER_COVERAGE_DIR was not set, coverage won't work."; |
| + } else { |
| + std::wstring coverage_dir(coverage_dir_size); |
| + coverage_dir_size = ::GetEnvironmentVariable( |
| + L"SANITIZER_COVERAGE_DIR", coverage_dir.data(), coverage_dir_size); |
|
cpu_(ooo_6.6-7.5)
2015/05/12 00:53:56
lgtm, please use base's WriteInto() instead of 36
Reid Kleckner
2015/05/12 16:03:07
Sure. I felt like the CHECK was calling out the as
|
| + CHECK(coverage_dir.size() == coverage_dir_size); |
| + base::FilePath sancov_path = |
| + base::FilePath(coverage_dir).Append(L"*.sancov"); |
| + result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_FILES, |
| + sandbox::TargetPolicy::FILES_ALLOW_ANY, |
| + sancov_path.value().c_str()); |
| + if (result != sandbox::SBOX_ALL_OK) |
| + return false; |
| + } |
| +#endif |
| + |
| AddGenericDllEvictionPolicy(policy); |
| return true; |
| } |