diff options
author | sky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-23 16:05:58 +0000 |
---|---|---|
committer | sky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-23 16:05:58 +0000 |
commit | 86dc25f56d7b1b379faedfc215f22f0fba3d5db6 (patch) | |
tree | 7ea34ddda03319963cb4aecd96d9473d36ee5262 /base | |
parent | 2eb517b30fa34102fa6f00bafc6c8d1948eace91 (diff) | |
download | chromium_src-86dc25f56d7b1b379faedfc215f22f0fba3d5db6.zip chromium_src-86dc25f56d7b1b379faedfc215f22f0fba3d5db6.tar.gz chromium_src-86dc25f56d7b1b379faedfc215f22f0fba3d5db6.tar.bz2 |
Decrements FieldTrialList::constructor_count_ in the destructor. I'm
going to run ui tests in process and call BrowserMain multiple
times. That means FieldTrialList's constructor is run multiple
times. Without this decrement, the constructor isn't happy.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/18535
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8554 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/field_trial.cc | 6 | ||||
-rw-r--r-- | base/field_trial.h | 4 | ||||
-rw-r--r-- | base/field_trial_unittest.cc | 1 |
3 files changed, 1 insertions, 10 deletions
diff --git a/base/field_trial.cc b/base/field_trial.cc index 9fd9d8f..c88ab65 100644 --- a/base/field_trial.cc +++ b/base/field_trial.cc @@ -15,13 +15,9 @@ using base::Time; // static FieldTrialList* FieldTrialList::global_ = NULL; -// static -int FieldTrialList::constructor_count_ = 0; - FieldTrialList::FieldTrialList() : application_start_time_(Time::Now()) { - DCHECK(!constructor_count_); - ++constructor_count_; + DCHECK(!global_); global_ = this; } diff --git a/base/field_trial.h b/base/field_trial.h index 99e213c..f392f88 100644 --- a/base/field_trial.h +++ b/base/field_trial.h @@ -80,11 +80,7 @@ class FieldTrialList : NonThreadSafe { private: typedef std::map<std::wstring, FieldTrial*> RegistrationList; - friend class FieldTrialTest; - static void ResetConstructorCountForTestingOnly() { constructor_count_ = 0; } - static FieldTrialList* global_; // The singleton of this class. - static int constructor_count_; // Prevent having more than one. base::Time application_start_time_; RegistrationList registered_; diff --git a/base/field_trial_unittest.cc b/base/field_trial_unittest.cc index 3d8c0e2..f7be7e0 100644 --- a/base/field_trial_unittest.cc +++ b/base/field_trial_unittest.cc @@ -12,7 +12,6 @@ class FieldTrialTest : public testing::Test { public: FieldTrialTest() : trial_list_() { } - ~FieldTrialTest() { FieldTrialList::ResetConstructorCountForTestingOnly(); } private: FieldTrialList trial_list_; |