зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1553850 - Add LLVM profiling to Windows Sandbox r=bobowen
Differential Revision: https://phabricator.services.mozilla.com/D218317
This commit is contained in:
Родитель
c4f8bbd378
Коммит
02f9f9f1d7
|
@ -268,6 +268,20 @@ static void AddDeveloperRepoDirToPolicy(sandbox::TargetPolicy* aPolicy) {
|
|||
repoPath.c_str());
|
||||
}
|
||||
|
||||
#if defined(MOZ_PROFILE_GENERATE)
|
||||
// It should only be allowed on instrumented builds, never on production
|
||||
// builds.
|
||||
static void AddLLVMProfilePathDirectoryToPolicy(
|
||||
sandbox::TargetPolicy* aPolicy) {
|
||||
std::wstring parentPath;
|
||||
if (GetLlvmProfileDir(parentPath)) {
|
||||
aPolicy->AddRule(sandbox::TargetPolicy::SUBSYS_FILES,
|
||||
sandbox::TargetPolicy::FILES_ALLOW_ANY,
|
||||
parentPath.c_str());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#undef WSTRING
|
||||
|
||||
Result<Ok, mozilla::ipc::LaunchError> SandboxBroker::LaunchApp(
|
||||
|
@ -322,6 +336,10 @@ Result<Ok, mozilla::ipc::LaunchError> SandboxBroker::LaunchApp(
|
|||
// Enable the child process to write log files when setup
|
||||
AddMozLogRulesToPolicy(mPolicy, aEnvironment);
|
||||
|
||||
#if defined(MOZ_PROFILE_GENERATE)
|
||||
AddLLVMProfilePathDirectoryToPolicy(mPolicy);
|
||||
#endif
|
||||
|
||||
if (!mozilla::IsPackagedBuild()) {
|
||||
AddDeveloperRepoDirToPolicy(mPolicy);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче