Commit 48c487e6 authored by wfh's avatar wfh Committed by Commit bot

Label sandbox job object OOM as OOM in process termination.

BUG=614440,630472
TEST=go to chrome://memory-exhaust on 64-bit Chrome and verify it gives the OOM sad tab.
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.win:win10_chromium_x64_rel_ng

Review-Url: https://codereview.chromium.org/2191643002
Cr-Commit-Position: refs/heads/master@{#408259}
parent f5e82714
......@@ -18,6 +18,16 @@ namespace base {
class ProcessFilter;
#if defined(OS_WIN)
namespace win {
// See definition in sandbox/win/src/sandbox_types.h
const DWORD kSandboxFatalMemoryExceeded = 7012;
} // namespace win
#endif // OS_WIN
// Return status values from GetTerminationStatus. Don't use these as
// exit code arguments to KillProcess*(), use platform/application
// specific values instead.
......
......@@ -148,6 +148,9 @@ TerminationStatus GetTerminationStatus(ProcessHandle handle, int* exit_code) {
case kDebuggerTerminatedExitCode: // Debugger terminated process.
case kProcessKilledExitCode: // Task manager kill.
return TERMINATION_STATUS_PROCESS_WAS_KILLED;
case base::win::kSandboxFatalMemoryExceeded: // Terminated process due to
// exceeding the sandbox job
// object memory limits.
case base::win::kOomExceptionCode: // Ran out of memory.
return TERMINATION_STATUS_OOM;
default:
......
......@@ -67,7 +67,6 @@
#include "ipc/ipc_descriptors.h"
#include "ipc/ipc_switches.h"
#include "media/base/media.h"
#include "sandbox/win/src/sandbox_types.h"
#include "ui/base/ui_base_paths.h"
#include "ui/base/ui_base_switches.h"
......@@ -81,6 +80,7 @@
#include "base/trace_event/trace_event_etw_export_win.h"
#include "base/win/process_startup_helper.h"
#include "sandbox/win/src/sandbox_types.h"
#include "ui/base/win/atl_module.h"
#include "ui/display/win/dpi.h"
#elif defined(OS_MACOSX)
......
......@@ -5,6 +5,7 @@
#ifndef SANDBOX_WIN_SRC_SANDBOX_TYPES_H_
#define SANDBOX_WIN_SRC_SANDBOX_TYPES_H_
#include "base/process/kill.h"
#include "base/process/launch.h"
namespace sandbox {
......@@ -121,6 +122,10 @@ enum TerminationCodes {
SBOX_FATAL_LAST
};
static_assert(SBOX_FATAL_MEMORY_EXCEEDED ==
base::win::kSandboxFatalMemoryExceeded,
"Value for SBOX_FATAL_MEMORY_EXCEEDED must match base.");
class BrokerServices;
class TargetServices;
......
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