Commit 37dac0ef authored by Paul Miller's avatar Paul Miller Committed by Commit Bot

WebView: Fix "unregistered pref" crash in variations setup

Instead of directly calling SafeSeedManager::RegisterPrefs, WebView
should call VariationsService::RegisterPrefs, as Chrome does.
VariationsService::RegisterPrefs calls SafeSeedManager::RegisterPrefs
and VariationsSeedStore::RegisterPrefs. The latter registers
kVariationsSafeCompressedSeed, which prevents the crash:
"Trying to read an unregistered pref: variations_safe_compressed_seed".

BUG=842934

Change-Id: I2f4fa631c2e03ecc650bb051e2050a89b7676e6e
Reviewed-on: https://chromium-review.googlesource.com/1060427Reviewed-by: default avatarTao Bai <michaelbai@chromium.org>
Commit-Queue: Paul Miller <paulmiller@chromium.org>
Cr-Commit-Position: refs/heads/master@{#558866}
parent d192d24c
......@@ -23,6 +23,7 @@
#include "components/variations/entropy_provider.h"
#include "components/variations/pref_names.h"
#include "components/variations/service/safe_seed_manager.h"
#include "components/variations/service/variations_service.h"
namespace android_webview {
namespace {
......@@ -76,7 +77,7 @@ std::unique_ptr<PrefService> AwFieldTrialCreator::CreateLocalState() {
variations::prefs::kVariationsPermanentConsistencyCountry,
std::make_unique<base::ListValue>());
variations::SafeSeedManager::RegisterPrefs(pref_registry.get());
variations::VariationsService::RegisterPrefs(pref_registry.get());
pref_service_factory_.set_user_prefs(
base::MakeRefCounted<InMemoryPrefStore>());
......
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