Chromium Code Reviews
DescriptionUpdating FeatureList default initialization pattern
FeatureList currently expects a singleton to be manually set by all code
which uses it. This works fine in the browser where it is intialized
and in unit tests which use a default initializer, however for code
outside the browser which relies on the various components in Chromium,
this causes their code to crash.
An example of this is CL:
https://codereview.chromium.org/2101283004/
This was an innocuous change in a component which CRD relied on.
Since the unit tests are set up to never catch these kind of problems,
our component started crashing and we had to investigate to figure out
the root cause.
This change updates the feature and trial checks to initialize the
singleton if it was not already initialized. If a caller tries to
re-initialize the singleton after that, the init code will DCHECK as
this represents a race condition and we want to ensure consistency for
the callers who rely on these checks being accurate.
BUG=624879
Review-Url: https://codereview.chromium.org/2110083007
Cr-Commit-Position: refs/heads/master@{#404243}
(cherry picked from commit 958f0473b8039a057b0e31412c2acae7dfda39cd)
Committed: https://chromium.googlesource.com/chromium/src/+/8ddcefe1e6ea7e133782e06b27e9767c94755840
Patch Set 1 #
Messages
Total messages: 2 (1 generated)
|
|||||||||||||||||||||||||||||||||||||