summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-14 20:50:51 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-14 20:50:51 +0000
commit9870279514ac12ef9e2bbe7aa622e7ebd5931b94 (patch)
tree30059c76d8effdcd1abfd0bef6fe5e40c2d4ea7d /net
parent695dba84e1c293019346752a5c6e2fa1328443f9 (diff)
downloadchromium_src-9870279514ac12ef9e2bbe7aa622e7ebd5931b94.zip
chromium_src-9870279514ac12ef9e2bbe7aa622e7ebd5931b94.tar.gz
chromium_src-9870279514ac12ef9e2bbe7aa622e7ebd5931b94.tar.bz2
Disk cache: Close the current experiment for new users.
(increasing the number of deleted entries) BUG=none TEST=none TBR=gavinp Review URL: http://codereview.chromium.org/3778002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62643 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/disk_cache/backend_impl.cc34
1 files changed, 6 insertions, 28 deletions
diff --git a/net/disk_cache/backend_impl.cc b/net/disk_cache/backend_impl.cc
index 2ad91e0..e02b79d 100644
--- a/net/disk_cache/backend_impl.cc
+++ b/net/disk_cache/backend_impl.cc
@@ -143,7 +143,7 @@ bool DelayedCacheCleanup(const FilePath& full_path) {
// Sets group for the current experiment. Returns false if the files should be
// discarded.
-bool InitExperiment(disk_cache::IndexHeader* header, uint32 mask) {
+bool InitExperiment(disk_cache::IndexHeader* header) {
if (header->experiment == disk_cache::EXPERIMENT_OLD_FILE1 ||
header->experiment == disk_cache::EXPERIMENT_OLD_FILE2) {
// Discard current cache.
@@ -154,31 +154,8 @@ bool InitExperiment(disk_cache::IndexHeader* header, uint32 mask) {
if (header->experiment >= disk_cache::EXPERIMENT_DELETED_LIST_OUT)
return true;
- if (!header->create_time || !header->lru.filled) {
- // Only for users with a full cache.
- header->experiment = disk_cache::EXPERIMENT_DELETED_LIST_OUT;
- return true;
- }
-
- int index_load = header->num_entries * 100 / (mask + 1);
- if (index_load > 20) {
- // Out of the experiment (~ 35% users).
- header->experiment = disk_cache::EXPERIMENT_DELETED_LIST_OUT;
- return true;
- }
-
- int option = base::RandInt(0, 5);
- if (option > 1) {
- // 60% out (39% of the total).
- header->experiment = disk_cache::EXPERIMENT_DELETED_LIST_OUT;
- } else if (!option) {
- // About 13% of the total.
- header->experiment = disk_cache::EXPERIMENT_DELETED_LIST_CONTROL;
- } else {
- // About 13% of the total.
- header->experiment = disk_cache::EXPERIMENT_DELETED_LIST_IN;
- }
-
+ // The experiment is closed.
+ header->experiment = disk_cache::EXPERIMENT_DELETED_LIST_OUT;
return true;
}
@@ -197,7 +174,8 @@ bool SetFieldTrialInfo(int size_group) {
std::string group1 = base::StringPrintf("CacheSizeGroup_%d", size_group);
trial1->AppendGroup(group1, base::FieldTrial::kAllRemainingProbability);
- scoped_refptr<base::FieldTrial> trial2 = new base::FieldTrial("CacheThrottle", 100);
+ scoped_refptr<base::FieldTrial> trial2 =
+ new base::FieldTrial("CacheThrottle", 100);
int group2a = trial2->AppendGroup("CacheThrottle_On", 10); // 10 % in.
trial2->AppendGroup("CacheThrottle_Off", 10); // 10 % control.
@@ -583,7 +561,7 @@ int BackendImpl::SyncInit() {
if (!(user_flags_ & disk_cache::kNoRandom) &&
cache_type_ == net::DISK_CACHE &&
- !InitExperiment(&data_->header, mask_))
+ !InitExperiment(&data_->header))
return net::ERR_FAILED;
// We don't care if the value overflows. The only thing we care about is that