Merge pull request #29382 from brave/p3a-crash-fix

P3A crash fix
This commit is contained in:
Darnell Andries
2025-06-04 19:14:24 -07:00
committed by GitHub
2 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -136,10 +136,10 @@ void MessageManager::Stop() {
void MessageManager::RemoveObsoleteLogs() {
for (MetricLogType log_type : kAllMetricLogTypes) {
if (json_log_stores_.contains(log_type)) {
if (json_log_stores_[log_type]) {
json_log_stores_[log_type]->RemoveObsoleteLogs();
}
if (constellation_prep_log_stores_.contains(log_type)) {
if (constellation_prep_log_stores_[log_type]) {
constellation_prep_log_stores_[log_type]->RemoveObsoleteLogs();
}
}
+4 -4
View File
@@ -210,10 +210,6 @@ void P3AService::Init(
}
#endif
if (local_state_->GetBoolean(kP3AEnabled)) {
message_manager_->Start(url_loader_factory_);
}
initialized_ = true;
// Store values that were recorded between calling constructor and |Init()|.
@@ -221,6 +217,10 @@ void P3AService::Init(
HandleHistogramChange(std::string(entry.first), entry.second);
}
histogram_values_.clear();
if (local_state_->GetBoolean(kP3AEnabled)) {
message_manager_->Start(url_loader_factory_);
}
}
void P3AService::OnRotation(MetricLogType log_type, bool is_constellation) {