summaryrefslogtreecommitdiffstats
path: root/net/disk_cache/backend_impl.cc
diff options
context:
space:
mode:
authorrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-21 00:11:20 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-21 00:11:20 +0000
commit9fb7a1288a3eac9730576b3ca75f763aa0a7a01f (patch)
tree578683808b906ede08b7ae9415e1f5084e10e953 /net/disk_cache/backend_impl.cc
parent590277b5baef3274cd4d9ffb9ee0215ea74356f2 (diff)
downloadchromium_src-9fb7a1288a3eac9730576b3ca75f763aa0a7a01f.zip
chromium_src-9fb7a1288a3eac9730576b3ca75f763aa0a7a01f.tar.gz
chromium_src-9fb7a1288a3eac9730576b3ca75f763aa0a7a01f.tar.bz2
Disk cache: Close the experiment for new users.
Also, make sure that only the main cache runs an experiment. BUG=none TEST=none Review URL: http://codereview.chromium.org/173132 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23923 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/backend_impl.cc')
-rw-r--r--net/disk_cache/backend_impl.cc35
1 files changed, 15 insertions, 20 deletions
diff --git a/net/disk_cache/backend_impl.cc b/net/disk_cache/backend_impl.cc
index a33697b..f61fab8 100644
--- a/net/disk_cache/backend_impl.cc
+++ b/net/disk_cache/backend_impl.cc
@@ -147,22 +147,16 @@ bool InitExperiment(int* current_group) {
}
if (*current_group <= 5) {
- // Re-load the two groups.
- int option = base::RandInt(0, 9);
-
- if (option > 1) {
- // 80% will be out of the experiment.
- *current_group = 9;
- } else {
- *current_group = option + 6;
- }
+ // The experiment is currently closed.
+ *current_group = 10;
}
// The current groups should be:
- // 6 control. (~10%)
- // 7 new eviction, upgraded data. (~10%)
+ // 6 control.
+ // 7 new eviction, upgraded data.
// 8 new eviction, from new files.
- // 9 out. (~80%)
+ // 9 out. (sort of control for group 8).
+ // 10 out.
UMA_HISTOGRAM_CACHE_ERROR("DiskCache.Experiment", *current_group);
@@ -183,7 +177,7 @@ void SetFieldTrialInfo(int experiment_group, int size_group) {
std::string group1 = StringPrintf("CacheSizeGroup_%d", size_group);
trial1->AppendGroup(group1, FieldTrial::kAllRemainingProbability);
- if (experiment_group < 6 || experiment_group > 8)
+ if (experiment_group < 6 || experiment_group > 9)
return;
scoped_refptr<FieldTrial> trial2 = new FieldTrial("NewEviction", 10);
@@ -288,7 +282,14 @@ bool BackendImpl::Init() {
}
init_ = true;
- if (!(user_flags_ & disk_cache::kNoRandom)) {
+
+ if (data_->header.experiment != 0 && cache_type_ != net::DISK_CACHE) {
+ // No experiment for other caches.
+ return false;
+ }
+
+ if (!(user_flags_ & disk_cache::kNoRandom) &&
+ cache_type_ == net::DISK_CACHE) {
// The unit test controls directly what to test.
if (!InitExperiment(&data_->header.experiment))
return false;
@@ -991,12 +992,6 @@ bool BackendImpl::CreateBackingStore(disk_cache::File* file) {
IndexHeader header;
header.table_len = DesiredIndexTableLen(max_size_);
- // All new profiles are going to use the new eviction.
- if (!(user_flags_ & disk_cache::kNoRandom)) {
- header.experiment = 8;
- new_eviction_ = true;
- }
-
// We need file version 2.1 for the new eviction algorithm.
if (new_eviction_)
header.version = 0x20001;