Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherry pick PR #3084: Add idl definition for PersistentSettingLogtraceEnable getter and setter #3091

Merged
merged 1 commit into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions cobalt/h5vcc/h5vcc_crash_log.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 4 additions & 0 deletions cobalt/h5vcc/h5vcc_crash_log.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string> GetLogTrace();
Expand Down
8 changes: 8 additions & 0 deletions cobalt/h5vcc/h5vcc_crash_log.idl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading