Bug 1041775 Part 3: Re-apply pre-vista stdout/err process inheritance change to Chromium code after merge. r=tabraldes

Originally landed as changsets:
https://hg.mozilla.org/mozilla-central/rev/f94a07671389
This commit is contained in:
Bob Owen 2014-11-18 15:11:47 +00:00
parent 44cdc5f024
commit 2a1adf9b3e
2 changed files with 9 additions and 1 deletions

View File

@ -1,5 +1,5 @@
Please add a link to the bugzilla bug and patch name that should be re-applied.
Also, please update any existing links to their actual mozilla-central changeset.
https://hg.mozilla.org/mozilla-central/rev/f94a07671389
https://bugzilla.mozilla.org/show_bug.cgi?id=1041775 bug1041775part2.patch
https://bugzilla.mozilla.org/show_bug.cgi?id=1041775 bug1041775part3.patch

View File

@ -445,6 +445,14 @@ ResultCode BrokerServicesBase::SpawnTarget(const wchar_t* exe_path,
// have limited which handles will be inherited.
inherit_handles = true;
}
} else if (getenv("MOZ_WIN_INHERIT_STD_HANDLES_PRE_VISTA")) {
// On pre-Vista versions even if we can't limit what gets inherited, we
// sometimes want to inherit stdout/err for testing purposes.
startup_info.startup_info()->dwFlags |= STARTF_USESTDHANDLES;
startup_info.startup_info()->hStdInput = INVALID_HANDLE_VALUE;
startup_info.startup_info()->hStdOutput = policy_base->GetStdoutHandle();
startup_info.startup_info()->hStdError = policy_base->GetStderrHandle();
inherit_handles = true;
}
// Construct the thread pool here in case it is expensive.