diff options
author | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-29 23:12:20 +0000 |
---|---|---|
committer | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-29 23:12:20 +0000 |
commit | 1d97be6e206ef861f45d5b0ea25c55dcc9993455 (patch) | |
tree | 4ff26fc89f17bc685176f5d1b97a328babbd2063 /net/disk_cache | |
parent | 2bc039a702f3d361e020c7584a5b3f786bee69d4 (diff) | |
download | chromium_src-1d97be6e206ef861f45d5b0ea25c55dcc9993455.zip chromium_src-1d97be6e206ef861f45d5b0ea25c55dcc9993455.tar.gz chromium_src-1d97be6e206ef861f45d5b0ea25c55dcc9993455.tar.bz2 |
Revert 94764 - Disk cache: Close the current experiment for new users.
Intended for the Beta branch.
(this is a reland of 88690)
BUG=91040
TEST=none
TBR=gavinp@chromium.org
Review URL: http://codereview.chromium.org/7518006
TBR=rvargas@google.com
Review URL: http://codereview.chromium.org/7453035
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94788 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache')
-rw-r--r-- | net/disk_cache/backend_impl.cc | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/net/disk_cache/backend_impl.cc b/net/disk_cache/backend_impl.cc index 900ea08..b03ecda 100644 --- a/net/disk_cache/backend_impl.cc +++ b/net/disk_cache/backend_impl.cc @@ -172,13 +172,35 @@ bool InitExperiment(disk_cache::IndexHeader* header, uint32 mask) { return false; } - // The current experiment is closed for new profiles. - if (header->experiment < disk_cache::EXPERIMENT_DELETED_LIST_OUT) - header->experiment = disk_cache::EXPERIMENT_DELETED_LIST_OUT; - - // If we are part of the experiment, set up the field trial. - if (header->experiment > disk_cache::EXPERIMENT_DELETED_LIST_OUT) + // See if we already defined the group for this profile. + if (header->experiment > disk_cache::EXPERIMENT_DELETED_LIST_OUT) { SetFieldTrialInfo(header->experiment); + return true; + } + + if (!header->create_time || !header->lru.filled) + return true; // Wait untill we fill up the cache. + + int index_load = header->num_entries * 100 / (mask + 1); + if (index_load > 25) { + // Out of the experiment (~18% users). + header->experiment = disk_cache::EXPERIMENT_DELETED_LIST_OUT2; + return true; + } + + int option = base::RandInt(0, 4); + if (option > 1) { + // 60% out (49% of the total). + header->experiment = disk_cache::EXPERIMENT_DELETED_LIST_OUT2; + } else if (!option) { + // About 16% of the total. + header->experiment = disk_cache::EXPERIMENT_DELETED_LIST_CONTROL; + } else { + // About 16% of the total. + header->experiment = disk_cache::EXPERIMENT_DELETED_LIST_IN; + } + + SetFieldTrialInfo(header->experiment); return true; } |