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

Side by Side Diff: base/metrics/field_trial.cc

Issue 2847813004: Specify the trial name when crashing due to missing default group name. (Closed)
Patch Set: Fix crash message. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/metrics/field_trial.h" 5 #include "base/metrics/field_trial.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/base_switches.h" 10 #include "base/base_switches.h"
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 accumulated_group_probability_(0), 407 accumulated_group_probability_(0),
408 next_group_number_(kDefaultGroupNumber + 1), 408 next_group_number_(kDefaultGroupNumber + 1),
409 group_(kNotFinalized), 409 group_(kNotFinalized),
410 enable_field_trial_(true), 410 enable_field_trial_(true),
411 forced_(false), 411 forced_(false),
412 group_reported_(false), 412 group_reported_(false),
413 trial_registered_(false), 413 trial_registered_(false),
414 ref_(FieldTrialList::FieldTrialAllocator::kReferenceNull) { 414 ref_(FieldTrialList::FieldTrialAllocator::kReferenceNull) {
415 DCHECK_GT(total_probability, 0); 415 DCHECK_GT(total_probability, 0);
416 DCHECK(!trial_name_.empty()); 416 DCHECK(!trial_name_.empty());
417 DCHECK(!default_group_name_.empty()); 417 DCHECK(!default_group_name_.empty())
418 << "Trial " << trial_name << " is missing a default group name.";
418 } 419 }
419 420
420 FieldTrial::~FieldTrial() {} 421 FieldTrial::~FieldTrial() {}
421 422
422 void FieldTrial::SetTrialRegistered() { 423 void FieldTrial::SetTrialRegistered() {
423 DCHECK_EQ(kNotFinalized, group_); 424 DCHECK_EQ(kNotFinalized, group_);
424 DCHECK(!trial_registered_); 425 DCHECK(!trial_registered_);
425 trial_registered_ = true; 426 trial_registered_ = true;
426 } 427 }
427 428
(...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after
1358 return; 1359 return;
1359 } 1360 }
1360 AutoLock auto_lock(global_->lock_); 1361 AutoLock auto_lock(global_->lock_);
1361 CHECK(!global_->PreLockedFind(trial->trial_name())) << trial->trial_name(); 1362 CHECK(!global_->PreLockedFind(trial->trial_name())) << trial->trial_name();
1362 trial->AddRef(); 1363 trial->AddRef();
1363 trial->SetTrialRegistered(); 1364 trial->SetTrialRegistered();
1364 global_->registered_[trial->trial_name()] = trial; 1365 global_->registered_[trial->trial_name()] = trial;
1365 } 1366 }
1366 1367
1367 } // namespace base 1368 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698