diff --git a/cobalt/h5vcc/h5vcc_crash_log.cc b/cobalt/h5vcc/h5vcc_crash_log.cc index a11a3adb5915..eba3dedb2e28 100644 --- a/cobalt/h5vcc/h5vcc_crash_log.cc +++ b/cobalt/h5vcc/h5vcc_crash_log.cc @@ -226,6 +226,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 0e5fa5cf985e..def1e67927d0 100644 --- a/cobalt/h5vcc/h5vcc_crash_log.h +++ b/cobalt/h5vcc/h5vcc_crash_log.h @@ -91,6 +91,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