OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // TODO(port): the ifdefs in here are a first step towards trying to determine | 5 // TODO(port): the ifdefs in here are a first step towards trying to determine |
6 // the correct abstraction for all the OS functionality required at this | 6 // the correct abstraction for all the OS functionality required at this |
7 // stage of process initialization. It should not be taken as a final | 7 // stage of process initialization. It should not be taken as a final |
8 // abstraction. | 8 // abstraction. |
9 | 9 |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 G_LOG_FLAG_FATAL | | 218 G_LOG_FLAG_FATAL | |
219 G_LOG_LEVEL_ERROR | | 219 G_LOG_LEVEL_ERROR | |
220 G_LOG_LEVEL_CRITICAL | | 220 G_LOG_LEVEL_CRITICAL | |
221 G_LOG_LEVEL_WARNING), | 221 G_LOG_LEVEL_WARNING), |
222 GLibLogHandler, | 222 GLibLogHandler, |
223 NULL); | 223 NULL); |
224 } | 224 } |
225 } | 225 } |
226 #endif // defined(OS_LINUX) | 226 #endif // defined(OS_LINUX) |
227 | 227 |
228 #if defined(OS_WIN) | |
229 extern "C" int _set_new_mode(int); | |
230 #endif | |
231 | |
232 // Register the invalid param handler and pure call handler to be able to | 228 // Register the invalid param handler and pure call handler to be able to |
233 // notify breakpad when it happens. | 229 // notify breakpad when it happens. |
234 void RegisterInvalidParamHandler() { | 230 void RegisterInvalidParamHandler() { |
235 #if defined(OS_WIN) | 231 #if defined(OS_WIN) |
236 _set_invalid_parameter_handler(InvalidParameter); | 232 _set_invalid_parameter_handler(InvalidParameter); |
237 _set_purecall_handler(PureCall); | 233 _set_purecall_handler(PureCall); |
238 // Gather allocation failure. | 234 // Gather allocation failure. |
239 std::set_new_handler(&OnNoMemory); | 235 std::set_new_handler(&OnNoMemory); |
240 // Also enable the new handler for malloc() based failures. | 236 // Also enable the new handler for malloc() based failures. |
241 _set_new_mode(1); | 237 _set_new_mode(1); |
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
659 | 655 |
660 logging::CleanupChromeLogging(); | 656 logging::CleanupChromeLogging(); |
661 | 657 |
662 #if defined(OS_MACOSX) && defined(GOOGLE_CHROME_BUILD) | 658 #if defined(OS_MACOSX) && defined(GOOGLE_CHROME_BUILD) |
663 // TODO(mark): See the TODO(mark) above at InitCrashReporter. | 659 // TODO(mark): See the TODO(mark) above at InitCrashReporter. |
664 DestructCrashReporter(); | 660 DestructCrashReporter(); |
665 #endif // OS_MACOSX && GOOGLE_CHROME_BUILD | 661 #endif // OS_MACOSX && GOOGLE_CHROME_BUILD |
666 | 662 |
667 return rv; | 663 return rv; |
668 } | 664 } |
OLD | NEW |