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

Issue 2825873002: [Chromecast] Use base::FeatureList to control features. (Closed)

Created:
3 years, 8 months ago by slan
Modified:
3 years, 8 months ago
CC:
chromium-reviews, alokp+watch_chromium.org, lcwu+watch_chromium.org, halliwell+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

[Chromecast] Use base::FeatureList to control features. In Chromium, Finch-enabled features are controlled through base::FeatureList, a class which abstracts the experiment framework and developer overrides from client code. Though Chromecast's experiment framework is fundamentally different (in that it is server-driven) Cast builds can still make use of this class. Introduce some utilities to help. At boot-up, the pref store will be queried for experiment configs, which were cached to disk on the most recent config fetch from the last boot cycle. If a developer overrides these features from the command line, that value takes precedence. These features will be used to initialize base::FeatureList, which can then be statically queried from any client code that depends on //base. This patch does not actually introduce or convert any existing features to use this framework. BUG=714291 BUG= internal b/35424335 Review-Url: https://codereview.chromium.org/2825873002 Cr-Commit-Position: refs/heads/master@{#466507} Committed: https://chromium.googlesource.com/chromium/src/+/ef03d2b9a67352094516f4e866373378fb961ee8

Patch Set 1 #

Patch Set 2 : Rebase. #

Total comments: 18

Patch Set 3 : halliwell comments addressed #

Total comments: 5

Patch Set 4 : Comments addressed, external browsertest added. #

Patch Set 5 : gn check #

Total comments: 17

Patch Set 6 : Updates. #

Total comments: 2

Patch Set 7 : Typo #

Unified diffs Side-by-side diffs Delta from patch set Stats (+749 lines, -5 lines) Patch
M chromecast/base/BUILD.gn View 2 chunks +3 lines, -0 lines 0 comments Download
A chromecast/base/cast_features.h View 1 2 3 4 5 1 chunk +52 lines, -0 lines 0 comments Download
A chromecast/base/cast_features.cc View 1 2 3 4 5 6 1 chunk +197 lines, -0 lines 0 comments Download
A chromecast/base/cast_features_unittest.cc View 1 2 3 4 5 1 chunk +285 lines, -0 lines 0 comments Download
M chromecast/base/pref_names.h View 1 chunk +2 lines, -0 lines 0 comments Download
M chromecast/base/pref_names.cc View 2 chunks +6 lines, -0 lines 0 comments Download
M chromecast/browser/BUILD.gn View 1 2 3 4 2 chunks +3 lines, -0 lines 0 comments Download
M chromecast/browser/cast_browser_main_parts.h View 2 chunks +2 lines, -0 lines 0 comments Download
M chromecast/browser/cast_browser_main_parts.cc View 4 chunks +23 lines, -5 lines 0 comments Download
M chromecast/browser/pref_service_helper.cc View 1 chunk +2 lines, -0 lines 0 comments Download
A chromecast/browser/test/cast_features_browsertest.cc View 1 2 3 4 5 1 chunk +174 lines, -0 lines 0 comments Download

Messages

Total messages: 32 (17 generated)
slan
Internal change here: https://eureka-internal-review.git.corp.google.com/#/c/71738/ I'd like to add an end-to-end test before this lands... still ...
3 years, 8 months ago (2017-04-19 22:57:12 UTC) #6
halliwell
A few nits but looking nice! https://codereview.chromium.org/2825873002/diff/20001/chromecast/base/cast_features.cc File chromecast/base/cast_features.cc (right): https://codereview.chromium.org/2825873002/diff/20001/chromecast/base/cast_features.cc#newcode25 chromecast/base/cast_features.cc:25: base::LazyInstance<std::unordered_set<int32_t>>::DestructorAtExit don't we ...
3 years, 8 months ago (2017-04-20 02:49:31 UTC) #7
slan
Thanks for the review. Comments addressed. https://codereview.chromium.org/2825873002/diff/20001/chromecast/base/cast_features.cc File chromecast/base/cast_features.cc (right): https://codereview.chromium.org/2825873002/diff/20001/chromecast/base/cast_features.cc#newcode25 chromecast/base/cast_features.cc:25: base::LazyInstance<std::unordered_set<int32_t>>::DestructorAtExit On 2017/04/20 ...
3 years, 8 months ago (2017-04-20 16:26:02 UTC) #8
maclellant
LGTM % comments https://codereview.chromium.org/2825873002/diff/40001/chromecast/base/cast_features.cc File chromecast/base/cast_features.cc (right): https://codereview.chromium.org/2825873002/diff/40001/chromecast/base/cast_features.cc#newcode88 chromecast/base/cast_features.cc:88: feature_list->RegisterFieldTrialOverride( Just checking, but it's safe ...
3 years, 8 months ago (2017-04-20 17:44:22 UTC) #9
halliwell
lgtm % Tavis's questions. https://codereview.chromium.org/2825873002/diff/40001/chromecast/base/cast_features_unittest.cc File chromecast/base/cast_features_unittest.cc (right): https://codereview.chromium.org/2825873002/diff/40001/chromecast/base/cast_features_unittest.cc#newcode98 chromecast/base/cast_features_unittest.cc:98: ASSERT_EQ(3.14159, base::GetFieldTrialParamByFeatureAsDouble( On 2017/04/20 17:44:21, ...
3 years, 8 months ago (2017-04-20 19:58:10 UTC) #10
slan
PTAL https://codereview.chromium.org/2825873002/diff/40001/chromecast/base/cast_features.cc File chromecast/base/cast_features.cc (right): https://codereview.chromium.org/2825873002/diff/40001/chromecast/base/cast_features.cc#newcode88 chromecast/base/cast_features.cc:88: feature_list->RegisterFieldTrialOverride( On 2017/04/20 17:44:21, maclellant wrote: > Just ...
3 years, 8 months ago (2017-04-20 20:51:55 UTC) #11
maclellant
SGTM. As long as our features don't depend on exact bit-level matching for float/double parameters, ...
3 years, 8 months ago (2017-04-20 21:00:04 UTC) #14
slan
+Alexei Alexei, would you mind taking a quick pass on cast_features.cc to inspect the initialization ...
3 years, 8 months ago (2017-04-21 19:15:57 UTC) #18
Alexei Svitkine (slow)
generally, lg - some comments below https://codereview.chromium.org/2825873002/diff/80001/chromecast/base/cast_features.cc File chromecast/base/cast_features.cc (right): https://codereview.chromium.org/2825873002/diff/80001/chromecast/base/cast_features.cc#newcode31 chromecast/base/cast_features.cc:31: int32_t id; Nit: ...
3 years, 8 months ago (2017-04-21 19:48:02 UTC) #19
slan
Alexei, thanks for the quick review! I took most of your suggestions. https://codereview.chromium.org/2825873002/diff/80001/chromecast/base/cast_features.cc File chromecast/base/cast_features.cc ...
3 years, 8 months ago (2017-04-21 21:43:28 UTC) #20
Alexei Svitkine (slow)
LGTM You should probably have a crbug and BUG= set for a change of this ...
3 years, 8 months ago (2017-04-21 21:46:03 UTC) #21
slan
Thanks! https://codereview.chromium.org/2825873002/diff/100001/chromecast/base/cast_features.cc File chromecast/base/cast_features.cc (right): https://codereview.chromium.org/2825873002/diff/100001/chromecast/base/cast_features.cc#newcode71 chromecast/base/cast_features.cc:71: // Feature's name as the FieldTrial name to ...
3 years, 8 months ago (2017-04-21 22:11:13 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2825873002/120001
3 years, 8 months ago (2017-04-21 22:12:03 UTC) #27
commit-bot: I haz the power
Committed patchset #7 (id:120001) as https://chromium.googlesource.com/chromium/src/+/ef03d2b9a67352094516f4e866373378fb961ee8
3 years, 8 months ago (2017-04-22 00:22:36 UTC) #31
slan
3 years, 8 months ago (2017-04-25 16:06:32 UTC) #32
Message was sent while issue was closed.
A revert of this CL (patchset #7 id:120001) has been created in
https://codereview.chromium.org/2838813003/ by slan@chromium.org.

The reason for reverting is: cast_features_browsertest.cc is flaky on our
internal CQ bot - it's unclear why this did not manifest on the Chromium
trybots. 

I assume that state persisting in the PrefService between tests is causing the
flakiness. Reverting this patch until I understand the root cause. .

Powered by Google App Engine
This is Rietveld 408576698