diff --git a/cobalt/h5vcc/h5vcc_crash_log.cc b/cobalt/h5vcc/h5vcc_crash_log.cc index e4bbbd04cc71..1f35d8bbeb83 100644 --- a/cobalt/h5vcc/h5vcc_crash_log.cc +++ b/cobalt/h5vcc/h5vcc_crash_log.cc @@ -176,6 +176,17 @@ void H5vccCrashLog::SetPersistentSettingWatchdogCrash(bool can_trigger_crash) { if (watchdog) watchdog->SetPersistentSettingWatchdogCrash(can_trigger_crash); } +bool H5vccCrashLog::GetPersistentSettingLogtraceEnable() { + watchdog::Watchdog* watchdog = watchdog::Watchdog::GetInstance(); + if (watchdog) return watchdog->GetPersistentSettingLogtraceEnable(); + return false; +} + +void H5vccCrashLog::SetPersistentSettingLogtraceEnable(bool enable_logtrace) { + watchdog::Watchdog* watchdog = watchdog::Watchdog::GetInstance(); + if (watchdog) watchdog->SetPersistentSettingLogtraceEnable(enable_logtrace); +} + bool H5vccCrashLog::LogEvent(const std::string& event) { watchdog::Watchdog* watchdog = watchdog::Watchdog::GetInstance(); if (!watchdog) { diff --git a/cobalt/h5vcc/h5vcc_crash_log.h b/cobalt/h5vcc/h5vcc_crash_log.h index 0ad68a675aa8..4f7f03be98a4 100644 --- a/cobalt/h5vcc/h5vcc_crash_log.h +++ b/cobalt/h5vcc/h5vcc_crash_log.h @@ -60,6 +60,10 @@ class H5vccCrashLog : public script::Wrappable { void SetPersistentSettingWatchdogCrash(bool can_trigger_crash); + bool GetPersistentSettingLogtraceEnable(); + + void SetPersistentSettingLogtraceEnable(bool enable_logtrace); + bool LogEvent(const std::string& event); script::Sequence GetLogTrace(); diff --git a/cobalt/h5vcc/h5vcc_crash_log.idl b/cobalt/h5vcc/h5vcc_crash_log.idl index 0596c0d24ec3..98e1b81e3e12 100644 --- a/cobalt/h5vcc/h5vcc_crash_log.idl +++ b/cobalt/h5vcc/h5vcc_crash_log.idl @@ -109,6 +109,14 @@ interface H5vccCrashLog { // Watchdog violation will trigger a crash. void setPersistentSettingWatchdogCrash(boolean can_trigger_crash); + // Gets a persistent setting that determines whether or not + // events emitted by logEvent() are saved in Cobalt buffer. + boolean getPersistentSettingLogtraceEnable(); + + // Sets a persistent setting that determines whether or not + // events emitted by logEvent() are saved in Cobalt buffer. + void setPersistentSettingLogtraceEnable(boolean enable_logtrace); + // Appends a string event to a ring buffer. These log events can be appended // from JS code. When watchdog violation is created, a snapshot of // that buffer is attached to a violation. Identical sequential events