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

CHECK on feature overrides reserve limit in non-component builds #24565

Merged
merged 1 commit into from
Jul 9, 2024
Merged
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
13 changes: 6 additions & 7 deletions chromium_src/base/feature_list.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,17 @@ UnsortedDefaultStateOverrides& GetUnsortedDefaultStateOverrides() {
}

const DefaultStateOverrides& GetDefaultStateOverrides() {
static const NoDestructor<DefaultStateOverrides> default_state_overrides([] {
static const NoDestructor<DefaultStateOverrides> kDefaultStateOverrides([] {
DefaultStateOverrides sorted_overrides =
std::move(GetUnsortedDefaultStateOverrides());
DCHECK_EQ(GetUnsortedDefaultStateOverrides().capacity(), 0u);
DLOG_IF(ERROR, sorted_overrides.size() > kDefaultStateOverridesReserve)
<< "Please increase kDefaultStateOverridesReserve. Feature overrides "
"count: "
<< sorted_overrides.size()
<< ", reserve size: " << kDefaultStateOverridesReserve;
#if !defined(COMPONENT_BUILD)
CHECK_GE(kDefaultStateOverridesReserve, sorted_overrides.size())
<< "kDefaultStateOverridesReserve should be increased";
#endif
return sorted_overrides;
}());
return *default_state_overrides;
return *kDefaultStateOverrides;
}

} // namespace
Expand Down
Loading