#48411: fix: initialze featurelist before parsing features
Description of Change
base::FeatureList
needs to be initialized before any features are parsed so that appropriate field trials are setup. Today we call InitializeFeatureList
from Electron::PreBrowserMain
and Electron::PostEarlyInitialization
however the feature list is initialized somewhere in between via Electron::PreEarlyInitialization
. This results in the following crash when launching the application with a feature param --enable-features="NetAdapterMaxBufSizeFeature:NetAdapterMaxBufSize/8192"
.
[56990:0929/130502.801852:FATAL:base/feature_list.cc:905] DCHECK failed: trial. trial='StudyNetAdapterMaxBufSizeFeature' does not exist
This PR addresses by moving the feature list initialization before any feature parsing happens. The instance leaked is on purpose aligning with upstream https://source.chromium.org/chromium/chromium/src/+/main:content/app/content_main_runner_impl.cc;l=1150-1155
Release Notes
Notes: fix crash when passing feature param from commandline --enable-features=Feature:ParamA/Value
Backports
Semver Impact
Semantic Versioning helps users understand the impact of updates:
- Major (X.y.z): Breaking changes that may require code modifications
- Minor (x.Y.z): New features that maintain backward compatibility
- Patch (x.y.Z): Bug fixes that don't change the API
- None: Changes that don't affect using facing parts of Electron