OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "build/build_config.h" | 5 #include "build/build_config.h" |
6 | 6 |
7 // Need to include this before most other files because it defines | 7 // Need to include this before most other files because it defines |
8 // IPC_MESSAGE_LOG_ENABLED. We need to use it to define | 8 // IPC_MESSAGE_LOG_ENABLED. We need to use it to define |
9 // IPC_MESSAGE_MACROS_LOG_ENABLED so render_messages.h will generate the | 9 // IPC_MESSAGE_MACROS_LOG_ENABLED so render_messages.h will generate the |
10 // ViewMsgLog et al. functions. | 10 // ViewMsgLog et al. functions. |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 // {7FE69228-633E-4f06-80C1-527FEA23E3A7} | 85 // {7FE69228-633E-4f06-80C1-527FEA23E3A7} |
86 const GUID kChromeTraceProviderName = { | 86 const GUID kChromeTraceProviderName = { |
87 0x7fe69228, 0x633e, 0x4f06, | 87 0x7fe69228, 0x633e, 0x4f06, |
88 { 0x80, 0xc1, 0x52, 0x7f, 0xea, 0x23, 0xe3, 0xa7 } }; | 88 { 0x80, 0xc1, 0x52, 0x7f, 0xea, 0x23, 0xe3, 0xa7 } }; |
89 #endif | 89 #endif |
90 | 90 |
91 // Assertion handler for logging errors that occur when dialogs are | 91 // Assertion handler for logging errors that occur when dialogs are |
92 // silenced. To record a new error, pass the log string associated | 92 // silenced. To record a new error, pass the log string associated |
93 // with that error in the str parameter. | 93 // with that error in the str parameter. |
94 MSVC_DISABLE_OPTIMIZE(); | 94 MSVC_DISABLE_OPTIMIZE(); |
95 void SilentRuntimeAssertHandler(const std::string& str) { | 95 void SilentRuntimeAssertHandler( |
| 96 const char* file, int line, size_t message_start, |
| 97 size_t stack_start, const std::string& str) { |
96 base::debug::BreakDebugger(); | 98 base::debug::BreakDebugger(); |
97 } | 99 } |
98 MSVC_ENABLE_OPTIMIZE(); | 100 MSVC_ENABLE_OPTIMIZE(); |
99 | 101 |
100 // Suppresses error/assertion dialogs and enables the logging of | 102 // Suppresses error/assertion dialogs and enables the logging of |
101 // those errors into silenced_errors_. | 103 // those errors into silenced_errors_. |
102 void SuppressDialogs() { | 104 void SuppressDialogs() { |
103 if (dialogs_are_suppressed_) | 105 if (dialogs_are_suppressed_) |
104 return; | 106 return; |
105 | 107 |
106 logging::SetLogAssertHandler(SilentRuntimeAssertHandler); | 108 logging::SetLogAssertHandler(base::Bind(SilentRuntimeAssertHandler)); |
107 | 109 |
108 #if defined(OS_WIN) | 110 #if defined(OS_WIN) |
109 UINT new_flags = SEM_FAILCRITICALERRORS | | 111 UINT new_flags = SEM_FAILCRITICALERRORS | |
110 SEM_NOGPFAULTERRORBOX | | 112 SEM_NOGPFAULTERRORBOX | |
111 SEM_NOOPENFILEERRORBOX; | 113 SEM_NOOPENFILEERRORBOX; |
112 | 114 |
113 // Preserve existing error mode, as discussed at http://t/dmea | 115 // Preserve existing error mode, as discussed at http://t/dmea |
114 UINT existing_flags = SetErrorMode(new_flags); | 116 UINT existing_flags = SetErrorMode(new_flags); |
115 SetErrorMode(existing_flags | new_flags); | 117 SetErrorMode(existing_flags | new_flags); |
116 #endif | 118 #endif |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 time_deets.year, | 418 time_deets.year, |
417 time_deets.month, | 419 time_deets.month, |
418 time_deets.day_of_month, | 420 time_deets.day_of_month, |
419 time_deets.hour, | 421 time_deets.hour, |
420 time_deets.minute, | 422 time_deets.minute, |
421 time_deets.second); | 423 time_deets.second); |
422 return base_path.InsertBeforeExtensionASCII(suffix); | 424 return base_path.InsertBeforeExtensionASCII(suffix); |
423 } | 425 } |
424 | 426 |
425 } // namespace logging | 427 } // namespace logging |
OLD | NEW |