summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-11 01:50:48 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-11 01:50:48 +0000
commit7e05f6c4baad4f81e06835b83febe2784568ebe1 (patch)
treee9f7079ff2c42ff257c9dd599d7896a0b7963126 /base
parent26f70b36e14369138eca64b68fca0ee3aa5a9b7a (diff)
downloadchromium_src-7e05f6c4baad4f81e06835b83febe2784568ebe1.zip
chromium_src-7e05f6c4baad4f81e06835b83febe2784568ebe1.tar.gz
chromium_src-7e05f6c4baad4f81e06835b83febe2784568ebe1.tar.bz2
Disk cache: Generate total-load-time histograms from the
disk cache experiment. BUG=none TEST=none Review URL: http://codereview.chromium.org/155380 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20452 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/field_trial.cc12
-rw-r--r--base/field_trial.h5
2 files changed, 13 insertions, 4 deletions
diff --git a/base/field_trial.cc b/base/field_trial.cc
index 2b354d7..0bf39e2 100644
--- a/base/field_trial.cc
+++ b/base/field_trial.cc
@@ -67,9 +67,12 @@ std::string FieldTrial::MakeName(const std::string& name_prefix,
// static
FieldTrialList* FieldTrialList::global_ = NULL;
-FieldTrialList::FieldTrialList()
- : application_start_time_(Time::Now()) {
+// static
+bool FieldTrialList::register_without_global_ = false;
+
+FieldTrialList::FieldTrialList() : application_start_time_(Time::Now()) {
DCHECK(!global_);
+ DCHECK(!register_without_global_);
global_ = this;
}
@@ -86,9 +89,10 @@ FieldTrialList::~FieldTrialList() {
// static
void FieldTrialList::Register(FieldTrial* trial) {
- DCHECK(global_);
- if (!global_)
+ if (!global_) {
+ register_without_global_ = true;
return;
+ }
AutoLock auto_lock(global_->lock_);
DCHECK(!global_->PreLockedFind(trial->name()));
trial->AddRef();
diff --git a/base/field_trial.h b/base/field_trial.h
index fba0b01..a26bde8f 100644
--- a/base/field_trial.h
+++ b/base/field_trial.h
@@ -210,6 +210,11 @@ class FieldTrialList {
static FieldTrialList* global_; // The singleton of this class.
+ // This will tell us if there is an attempt to register a field trial without
+ // creating the FieldTrialList. This is not an error, unless a FieldTrialList
+ // is created after that.
+ static bool register_without_global_;
+
// A helper value made availabel to users, that shows when the FieldTrialList
// was initialized. Note that this is a singleton instance, and hence is a
// good approximation to the start of the process.