Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Side by Side Diff: content/app/startup_helper_win.cc

Issue 836733006: Fix EnableTerminationOnOutOfMemory for malloc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix calloc Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/app/content_main_runner.cc ('k') | skia/ext/SkMemory_new_handler.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/public/app/startup_helper_win.h" 5 #include "content/public/app/startup_helper_win.h"
6 6
7 #include <crtdbg.h> 7 #include <crtdbg.h>
8 #include <new.h> 8 #include <new.h>
9 9
10 #include "base/base_switches.h" 10 #include "base/base_switches.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 sandbox::MITIGATION_DEP | 45 sandbox::MITIGATION_DEP |
46 sandbox::MITIGATION_DEP_NO_ATL_THUNK); 46 sandbox::MITIGATION_DEP_NO_ATL_THUNK);
47 } 47 }
48 } 48 }
49 49
50 // Register the invalid param handler and pure call handler to be able to 50 // Register the invalid param handler and pure call handler to be able to
51 // notify breakpad when it happens. 51 // notify breakpad when it happens.
52 void RegisterInvalidParamHandler() { 52 void RegisterInvalidParamHandler() {
53 _set_invalid_parameter_handler(InvalidParameter); 53 _set_invalid_parameter_handler(InvalidParameter);
54 _set_purecall_handler(PureCall); 54 _set_purecall_handler(PureCall);
55 // Also enable the new handler for malloc() based failures.
56 _set_new_mode(1);
57 } 55 }
58 56
59 void SetupCRT(const base::CommandLine& command_line) { 57 void SetupCRT(const base::CommandLine& command_line) {
60 #if defined(_CRTDBG_MAP_ALLOC) 58 #if defined(_CRTDBG_MAP_ALLOC)
61 _CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR); 59 _CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR);
62 _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE); 60 _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE);
63 #else 61 #else
64 if (!command_line.HasSwitch(switches::kDisableBreakpad)) { 62 if (!command_line.HasSwitch(switches::kDisableBreakpad)) {
65 _CrtSetReportMode(_CRT_ASSERT, 0); 63 _CrtSetReportMode(_CRT_ASSERT, 0);
66 } 64 }
67 #endif 65 #endif
68 } 66 }
69 67
70 } // namespace content 68 } // namespace content
OLDNEW
« no previous file with comments | « content/app/content_main_runner.cc ('k') | skia/ext/SkMemory_new_handler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698