summaryrefslogtreecommitdiffstats
path: root/net/disk_cache
diff options
context:
space:
mode:
Diffstat (limited to 'net/disk_cache')
-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