Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(769)

Issue 2138923002: Updating FeatureList default initialization pattern (Closed)

Created:
4 years, 5 months ago by Sergey Ulanov
Modified:
4 years, 5 months ago
Reviewers:
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@2785
Target Ref:
refs/pending/branch-heads/2785
Project:
chromium
Visibility:
Public.

Description

Updating 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+27 lines, -7 lines) Patch
M base/feature_list.h View 1 chunk +2 lines, -2 lines 0 comments Download
M base/feature_list.cc View 5 chunks +14 lines, -5 lines 0 comments Download
M base/feature_list_unittest.cc View 1 chunk +11 lines, -0 lines 0 comments Download

Messages

Total messages: 2 (1 generated)
Sergey Ulanov
4 years, 5 months ago (2016-07-11 17:43:32 UTC) #2
Message was sent while issue was closed.
Committed patchset #1 (id:1) manually as
8ddcefe1e6ea7e133782e06b27e9767c94755840.

Powered by Google App Engine
This is Rietveld 408576698