Add a switch to enable DCHECKs in release builds (issue #790).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@930 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2012-11-28 19:03:15 +00:00
parent cc2801d1d5
commit faf218df4a
6 changed files with 20 additions and 5 deletions

View File

@@ -223,6 +223,9 @@ bool CefMainDelegate::BasicStartupComplete(int* exit_code) {
command_line->AppendSwitchASCII(switches::kLogSeverity, log_severity);
}
if (settings.release_dcheck_enabled)
command_line->AppendSwitch(switches::kReleaseDcheckEnabled);
if (settings.javascript_flags.length > 0) {
command_line->AppendSwitchASCII(switches::kJavaScriptFlags,
CefString(&settings.javascript_flags));
@@ -305,17 +308,18 @@ bool CefMainDelegate::BasicStartupComplete(int* exit_code) {
if (log_severity == LOGSEVERITY_DISABLE) {
logging_dest = logging::LOG_NONE;
} else {
#if defined(OS_WIN)
logging_dest = logging::LOG_ONLY_TO_FILE;
#else
logging_dest = logging::LOG_TO_BOTH_FILE_AND_SYSTEM_DEBUG_LOG;
#endif
logging::SetMinLogLevel(log_severity);
}
logging::DcheckState dcheck_state =
logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS;
if (command_line->HasSwitch(switches::kReleaseDcheckEnabled))
dcheck_state = logging::ENABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS;
logging::InitLogging(log_file.value().c_str(), logging_dest,
logging::DONT_LOCK_LOG_FILE, logging::APPEND_TO_OLD_LOG_FILE,
logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS);
dcheck_state);
content::SetContentClient(&content_client_);