Commit 7aa1af9d authored by asvitkine's avatar asvitkine Committed by Commit bot

Add more debugging CHECKS to diagnose an Android renderer crash.

Suspicion is that CreateTrialsFromSeed() is being called more than
once, so add some CHECKs that will help diagnose it. If it's not
being called twice but the same field trial is being registered
twice, this can also cause the same issue - so catch that too.

BUG=359406

Review URL: https://codereview.chromium.org/1632913004

Cr-Commit-Position: refs/heads/master@{#372252}
parent f05ce520
......@@ -638,7 +638,7 @@ void FieldTrialList::Register(FieldTrial* trial) {
return;
}
AutoLock auto_lock(global_->lock_);
DCHECK(!global_->PreLockedFind(trial->trial_name()));
CHECK(!global_->PreLockedFind(trial->trial_name())) << trial->trial_name();
trial->AddRef();
trial->SetTrialRegistered();
global_->registered_[trial->trial_name()] = trial;
......
......@@ -300,6 +300,7 @@ VariationsService::~VariationsService() {
bool VariationsService::CreateTrialsFromSeed(base::FeatureList* feature_list) {
DCHECK(thread_checker_.CalledOnValidThread());
CHECK(!create_trials_from_seed_called_);
create_trials_from_seed_called_ = true;
......
......@@ -276,6 +276,7 @@ TEST_F(VariationsServiceTest, CreateTrialsFromSeed) {
TestVariationsService service(
make_scoped_ptr(new web_resource::TestRequestAllowedNotifier(&prefs)),
&prefs);
service.SetCreateTrialsFromSeedCalledForTesting(false);
// Store a seed.
service.StoreSeed(SerializeSeed(CreateTestSeed()), std::string(),
......@@ -306,6 +307,7 @@ TEST_F(VariationsServiceTest, CreateTrialsFromSeedNoLastFetchTime) {
TestVariationsService service(
make_scoped_ptr(new web_resource::TestRequestAllowedNotifier(&prefs)),
&prefs);
service.SetCreateTrialsFromSeedCalledForTesting(false);
// Store a seed. To simulate a first run, |prefs::kVariationsLastFetchTime|
// is left empty.
......@@ -336,6 +338,7 @@ TEST_F(VariationsServiceTest, CreateTrialsFromOutdatedSeed) {
TestVariationsService service(
make_scoped_ptr(new web_resource::TestRequestAllowedNotifier(&prefs)),
&prefs);
service.SetCreateTrialsFromSeedCalledForTesting(false);
// Store a seed, with a fetch time 31 days in the past.
const base::Time seed_date =
......
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