Commit a4c78341 authored by Paul Miller's avatar Paul Miller Committed by Commit Bot

WebView: Prepare to enable variations, part 2

Pass the seed via the "firstrun" mechanism and don't early out of
mLoadTask if sVariationsAlwaysEnabled is true. These changes were
mistakenly removed from b6aa89ae before
committing.

BUG=678288

Change-Id: I744bfa04291352b691f0c53407c3fe3cac526abf
Reviewed-on: https://chromium-review.googlesource.com/1053182Reviewed-by: default avatarBo <boliu@chromium.org>
Commit-Queue: Paul Miller <paulmiller@chromium.org>
Cr-Commit-Position: refs/heads/master@{#557362}
parent 6028742d
......@@ -23,6 +23,7 @@ import org.chromium.base.VisibleForTesting;
import org.chromium.base.metrics.CachedMetrics.EnumeratedHistogramSample;
import org.chromium.base.metrics.CachedMetrics.TimesHistogramSample;
import org.chromium.components.variations.LoadSeedResult;
import org.chromium.components.variations.firstrun.VariationsSeedBridge;
import org.chromium.components.variations.firstrun.VariationsSeedFetcher.SeedInfo;
import java.io.File;
......@@ -125,7 +126,7 @@ public class VariationsSeedLoader {
private FutureTask<SeedInfo> mLoadTask = new FutureTask<>(() -> {
mEnabledByExperiment = checkEnabledByExperiment();
if (!(mEnabledByCmd || mEnabledByExperiment)) return null;
if (!isVariationsEnabled()) return null;
AwMetricsServiceClient.preloadClientId();
......@@ -338,15 +339,12 @@ public class VariationsSeedLoader {
// variations.
public void finishVariationsInit() {
SeedInfo seed = getSeedBlockingAndLog();
// If enabled by experiment but not cmd, then also enable by cmd.
// isVariationsEnabled() must not be called before getSeedBlockingAndLog() returns.
// TODO(paulmiller): Remove this after completing the experiment.
if (mRunnable.isVariationsEnabled() && !isEnabledByCmd()) {
CommandLine.getInstance().appendSwitch(AwSwitches.ENABLE_WEBVIEW_VARIATIONS);
if (seed != null) {
if (!isEnabledByCmd()) {
CommandLine.getInstance().appendSwitch(AwSwitches.ENABLE_WEBVIEW_VARIATIONS);
}
VariationsSeedBridge.setVariationsFirstRunSeed(
seed.seedData, seed.signature, seed.country, seed.date, seed.isGzipCompressed);
}
// TODO(paulmiller): Once we have actual seeds, this would be the place to do:
// if (seed != null) { VariationsSeedBridge.setVariationsFirstRunSeed(seed); }
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment