Bug 1839531 - Don't check the pref javascript.options.asyncstack during shutdown. r=canaltinova

Getting a preference will always fail during shutdown, so avoid doing it.
The goal here is to avoid what is perhaps the most common source of warning
spam in logs in debug builds.

Differential Revision: https://phabricator.services.mozilla.com/D181585
This commit is contained in:
Andrew McCreight 2023-06-21 13:25:51 +00:00
Родитель 3424c000a7
Коммит a5b49717a3
1 изменённых файлов: 6 добавлений и 3 удалений

Просмотреть файл

@ -2704,7 +2704,8 @@ struct PreRecordedMetaInformation {
// This function should be called out of the profiler lock.
// It gathers non-trivial data that doesn't require the profiler to stop, or for
// which the request could theoretically deadlock if the profiler is locked.
static PreRecordedMetaInformation PreRecordMetaInformation() {
static PreRecordedMetaInformation PreRecordMetaInformation(
bool aShutdown = false) {
MOZ_ASSERT(!PSAutoLock::IsLockedOnCurrentThread());
PreRecordedMetaInformation info = {}; // Aggregate-init all fields.
@ -2719,7 +2720,8 @@ static PreRecordedMetaInformation PreRecordMetaInformation() {
return info;
}
info.mAsyncStacks = Preferences::GetBool("javascript.options.asyncstack");
info.mAsyncStacks =
!aShutdown && Preferences::GetBool("javascript.options.asyncstack");
nsresult res;
@ -5331,7 +5333,8 @@ void profiler_shutdown(IsFastShutdown aIsFastShutdown) {
}
invoke_profiler_state_change_callbacks(ProfilingState::ShuttingDown);
const auto preRecordedMetaInformation = PreRecordMetaInformation();
const auto preRecordedMetaInformation =
PreRecordMetaInformation(/* aShutdown = */ true);
ProfilerParent::ProfilerWillStopIfStarted();