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

Unified Diff: chrome/common/logging_chrome.cc

Issue 2638763004: Report CHECK/DCHECK to test launcher summary output. (Closed)
Patch Set: Add test for assert handlers nesting. Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/test/test_suite.cc ('k') | ios/chrome/browser/ui/collection_view/collection_view_model_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/logging_chrome.cc
diff --git a/chrome/common/logging_chrome.cc b/chrome/common/logging_chrome.cc
index e9e51b130ea2b85aa63275000f81fbe022f939cd..6a5d7f88ee0674418f30f65cbb50e248045e7bbb 100644
--- a/chrome/common/logging_chrome.cc
+++ b/chrome/common/logging_chrome.cc
@@ -69,6 +69,7 @@ namespace {
// When true, this means that error dialogs should not be shown.
bool dialogs_are_suppressed_ = false;
+logging::ScopedLogAssertHandler* assert_handler_ = nullptr;
// This should be true for exactly the period between the end of
// InitChromeLogging() and the beginning of CleanupChromeLogging().
@@ -92,7 +93,10 @@ const GUID kChromeTraceProviderName = {
// silenced. To record a new error, pass the log string associated
// with that error in the str parameter.
MSVC_DISABLE_OPTIMIZE();
-void SilentRuntimeAssertHandler(const std::string& str) {
+void SilentRuntimeAssertHandler(const char* file,
+ int line,
+ const base::StringPiece message,
+ const base::StringPiece stack_trace) {
base::debug::BreakDebugger();
}
MSVC_ENABLE_OPTIMIZE();
@@ -103,7 +107,8 @@ void SuppressDialogs() {
if (dialogs_are_suppressed_)
return;
- logging::SetLogAssertHandler(SilentRuntimeAssertHandler);
+ assert_handler_ = new logging::ScopedLogAssertHandler(
+ base::Bind(SilentRuntimeAssertHandler));
#if defined(OS_WIN)
UINT new_flags = SEM_FAILCRITICALERRORS |
« no previous file with comments | « base/test/test_suite.cc ('k') | ios/chrome/browser/ui/collection_view/collection_view_model_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698