Commit 5f4aded6 authored by John Abd-El-Malek's avatar John Abd-El-Malek Committed by Commit Bot

Fix network service not working when running as a remote app before Windows 8.

r562058 made the network process always run in a job object to try to avoid it outliving the browser process. This was added to make the network process quit sooner if there was a lot of pending I/O, which happened with layout tests. Windows before version 8 doesn't support nested job objects though, so we need to stop this mitigation for those old versions.

Bug: 904361
Change-Id: If75fc933052b1b7d4ef3d3e90664f777624c04d7
Reviewed-on: https://chromium-review.googlesource.com/c/1350977
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: default avatarJulian Pastarmov <pastarmovj@chromium.org>
Reviewed-by: default avatarJames Forshaw <forshaw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#611856}
parent 72fae848
...@@ -860,7 +860,12 @@ sandbox::ResultCode SandboxWin::StartSandboxedProcess( ...@@ -860,7 +860,12 @@ sandbox::ResultCode SandboxWin::StartSandboxedProcess(
service_manager::switches::kNoSandbox)) { service_manager::switches::kNoSandbox)) {
base::LaunchOptions options; base::LaunchOptions options;
options.handles_to_inherit = handles_to_inherit; options.handles_to_inherit = handles_to_inherit;
if (sandbox_type == SANDBOX_TYPE_NETWORK) { BOOL in_job = true;
// Prior to Windows 8 nested jobs aren't possible.
if (sandbox_type == SANDBOX_TYPE_NETWORK &&
(base::win::GetVersion() >= base::win::VERSION_WIN8 ||
(::IsProcessInJob(::GetCurrentProcess(), nullptr, &in_job) &&
!in_job))) {
// Launch the process in a job to ensure that the network process doesn't // Launch the process in a job to ensure that the network process doesn't
// outlive the browser. This could happen if there is a lot of I/O on // outlive the browser. This could happen if there is a lot of I/O on
// process shutdown, in which case TerminateProcess would fail. // process shutdown, in which case TerminateProcess would fail.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment