Add a switch to enable DCHECKs in release builds (issue #790).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@931 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
parent
faf218df4a
commit
4a3b1ec9e2
|
@ -156,6 +156,11 @@ typedef struct _cef_settings_t {
|
|||
///
|
||||
cef_log_severity_t log_severity;
|
||||
|
||||
///
|
||||
// Enable DCHECK in release mode to ease debugging.
|
||||
///
|
||||
bool release_dcheck_enabled;
|
||||
|
||||
///
|
||||
// The graphics implementation that CEF will use for rendering GPU accelerated
|
||||
// content like WebGL, accelerated layers and 3D CSS.
|
||||
|
|
|
@ -283,6 +283,7 @@ struct CefSettingsTraits {
|
|||
cef_string_set(src->log_file.str, src->log_file.length, &target->log_file,
|
||||
copy);
|
||||
target->log_severity = src->log_severity;
|
||||
target->release_dcheck_enabled = src->release_dcheck_enabled;
|
||||
target->graphics_implementation = src->graphics_implementation;
|
||||
target->local_storage_quota = src->local_storage_quota;
|
||||
target->session_storage_quota = src->session_storage_quota;
|
||||
|
|
|
@ -72,18 +72,19 @@ void CefProcessUIThread::Init() {
|
|||
if (settings.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(settings.log_severity);
|
||||
}
|
||||
|
||||
FilePath log_file = FilePath(CefString(&settings.log_file));
|
||||
logging::DcheckState dcheck_state =
|
||||
logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS;
|
||||
if (settings.release_dcheck_enabled)
|
||||
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);
|
||||
|
||||
// Load ICU data tables.
|
||||
bool ret = icu_util::Initialize();
|
||||
|
|
|
@ -225,6 +225,9 @@ void AppGetSettings(CefSettings& settings, CefRefPtr<CefApp>& app) {
|
|||
}
|
||||
}
|
||||
|
||||
settings.release_dcheck_enabled =
|
||||
g_command_line->HasSwitch(cefclient::kReleaseDcheckEnabled);
|
||||
|
||||
{
|
||||
std::string str = g_command_line->GetSwitchValue(cefclient::kGraphicsImpl);
|
||||
if (!str.empty()) {
|
||||
|
|
|
@ -24,6 +24,7 @@ const char kLogSeverity_Warning[] = "warning";
|
|||
const char kLogSeverity_Error[] = "error";
|
||||
const char kLogSeverity_ErrorReport[] = "error-report";
|
||||
const char kLogSeverity_Disable[] = "disable";
|
||||
const char kReleaseDcheckEnabled[] = "release-dcheck-enabled";
|
||||
const char kGraphicsImpl[] = "graphics-implementation";
|
||||
const char kGraphicsImpl_Angle[] = "angle";
|
||||
const char kGraphicsImpl_AngleCmdBuffer[] = "angle-command-buffer";
|
||||
|
|
|
@ -26,6 +26,7 @@ extern const char kLogSeverity_Warning[];
|
|||
extern const char kLogSeverity_Error[];
|
||||
extern const char kLogSeverity_ErrorReport[];
|
||||
extern const char kLogSeverity_Disable[];
|
||||
extern const char kReleaseDcheckEnabled[];
|
||||
extern const char kGraphicsImpl[];
|
||||
extern const char kGraphicsImpl_Angle[];
|
||||
extern const char kGraphicsImpl_AngleCmdBuffer[];
|
||||
|
|
|
@ -101,6 +101,9 @@ void CefTestSuite::GetSettings(CefSettings& settings) {
|
|||
}
|
||||
}
|
||||
|
||||
settings.release_dcheck_enabled =
|
||||
commandline_->HasSwitch(cefclient::kReleaseDcheckEnabled);
|
||||
|
||||
{
|
||||
std::string str =
|
||||
commandline_->GetSwitchValueASCII(cefclient::kGraphicsImpl);
|
||||
|
|
Loading…
Reference in New Issue