diff options
author | cpu <cpu@chromium.org> | 2015-01-27 10:13:45 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-01-27 18:14:29 +0000 |
commit | 3e11a840e89d6dce0084fc4631366b88117b5eea (patch) | |
tree | f9995be84cd1f05db8b274da9a3fba9bd766a73a /content/app | |
parent | a0046208af1f285b95809ed9e79a48f8d95a1522 (diff) | |
download | chromium_src-3e11a840e89d6dce0084fc4631366b88117b5eea.zip chromium_src-3e11a840e89d6dce0084fc4631366b88117b5eea.tar.gz chromium_src-3e11a840e89d6dce0084fc4631366b88117b5eea.tar.bz2 |
Fix EnableTerminationOnOutOfMemory for malloc
Currently only crashes on new and new[]. With the change it will also
crash when there is no memory for malloc as well.
BUG=434397
TEST=none.
Committed: https://crrev.com/22d64abdc792516fd0f4895b26ae3a73c85239e0
Cr-Commit-Position: refs/heads/master@{#310320}
Review URL: https://codereview.chromium.org/836733006
Cr-Commit-Position: refs/heads/master@{#313307}
Diffstat (limited to 'content/app')
-rw-r--r-- | content/app/content_main_runner.cc | 2 | ||||
-rw-r--r-- | content/app/startup_helper_win.cc | 2 |
2 files changed, 1 insertions, 3 deletions
diff --git a/content/app/content_main_runner.cc b/content/app/content_main_runner.cc index 8795067..6302e96 100644 --- a/content/app/content_main_runner.cc +++ b/content/app/content_main_runner.cc @@ -486,6 +486,7 @@ class ContentMainRunnerImpl : public ContentMainRunner { int Initialize(const ContentMainParams& params) override { ui_task_ = params.ui_task; + base::EnableTerminationOnOutOfMemory(); #if defined(OS_WIN) RegisterInvalidParamHandler(); ui::win::CreateATLModuleIfNeeded(); @@ -602,7 +603,6 @@ class ContentMainRunnerImpl : public ContentMainRunner { if (!delegate_ || delegate_->ShouldEnableTerminationOnHeapCorruption()) base::EnableTerminationOnHeapCorruption(); - base::EnableTerminationOnOutOfMemory(); #if !defined(OS_IOS) SetProcessTitleFromCommandLine(argv); diff --git a/content/app/startup_helper_win.cc b/content/app/startup_helper_win.cc index e19630f..187a0f0 100644 --- a/content/app/startup_helper_win.cc +++ b/content/app/startup_helper_win.cc @@ -53,8 +53,6 @@ void InitializeSandboxInfo(sandbox::SandboxInterfaceInfo* info) { void RegisterInvalidParamHandler() { _set_invalid_parameter_handler(InvalidParameter); _set_purecall_handler(PureCall); - // Also enable the new handler for malloc() based failures. - _set_new_mode(1); } void SetupCRT(const base::CommandLine& command_line) { |