diff options
author | isherman <isherman@chromium.org> | 2015-03-31 15:04:29 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-03-31 22:05:18 +0000 |
commit | 292673a58ddf1fd9d0f83badf7b448575731eca4 (patch) | |
tree | ed6ba3810145125bbc8afd153de0ec7acba11a8e | |
parent | d7f6a672d1d0487803be8a7984e52f06f648fe4c (diff) | |
download | chromium_src-292673a58ddf1fd9d0f83badf7b448575731eca4.zip chromium_src-292673a58ddf1fd9d0f83badf7b448575731eca4.tar.gz chromium_src-292673a58ddf1fd9d0f83badf7b448575731eca4.tar.bz2 |
[Clean up] Remove the obsolete "Infinite Cache" field trial.
Along the way, also clean up some other obsolete field trial initialization code
on desktop.
BUG=470630
TEST=none
R=asvitkine@chromium.org, rvargas@chromium.org
Review URL: https://codereview.chromium.org/1048733002
Cr-Commit-Position: refs/heads/master@{#323123}
-rw-r--r-- | chrome/browser/chrome_browser_field_trials.cc | 5 | ||||
-rw-r--r-- | chrome/browser/chrome_browser_field_trials.h | 4 | ||||
-rw-r--r-- | chrome/browser/chrome_browser_field_trials_desktop.cc | 30 | ||||
-rw-r--r-- | chrome/browser/chrome_browser_main.cc | 3 | ||||
-rw-r--r-- | chrome/browser/profiles/profile_impl.cc | 8 | ||||
-rw-r--r-- | chrome/browser/profiles/profile_impl_io_data.cc | 4 | ||||
-rw-r--r-- | chrome/browser/profiles/profile_impl_io_data.h | 2 | ||||
-rw-r--r-- | net/http/http_cache.cc | 11 | ||||
-rw-r--r-- | net/http/http_cache.h | 3 |
9 files changed, 5 insertions, 65 deletions
diff --git a/chrome/browser/chrome_browser_field_trials.cc b/chrome/browser/chrome_browser_field_trials.cc index 55f83b7..2a6a432 100644 --- a/chrome/browser/chrome_browser_field_trials.cc +++ b/chrome/browser/chrome_browser_field_trials.cc @@ -29,10 +29,7 @@ ChromeBrowserFieldTrials::ChromeBrowserFieldTrials( ChromeBrowserFieldTrials::~ChromeBrowserFieldTrials() { } -void ChromeBrowserFieldTrials::SetupFieldTrials( - const base::Time& install_time) { - DCHECK(!install_time.is_null()); - +void ChromeBrowserFieldTrials::SetupFieldTrials() { // Field trials that are shared by all platforms. InstantiateDynamicTrials(); diff --git a/chrome/browser/chrome_browser_field_trials.h b/chrome/browser/chrome_browser_field_trials.h index 30ed2d6..d013918 100644 --- a/chrome/browser/chrome_browser_field_trials.h +++ b/chrome/browser/chrome_browser_field_trials.h @@ -17,9 +17,7 @@ class ChromeBrowserFieldTrials { explicit ChromeBrowserFieldTrials(const base::CommandLine& command_line); ~ChromeBrowserFieldTrials(); - // Called by the browser main sequence to set up Field Trials for this client. - // |local_state| is used to set browser-wide properties. - void SetupFieldTrials(const base::Time& install_time); + void SetupFieldTrials(); private: // Instantiates dynamic trials by querying their state, to ensure they get diff --git a/chrome/browser/chrome_browser_field_trials_desktop.cc b/chrome/browser/chrome_browser_field_trials_desktop.cc index d836695..b5f2f1f 100644 --- a/chrome/browser/chrome_browser_field_trials_desktop.cc +++ b/chrome/browser/chrome_browser_field_trials_desktop.cc @@ -8,19 +8,12 @@ #include "base/command_line.h" #include "base/metrics/field_trial.h" -#include "base/strings/string_util.h" #include "chrome/browser/auto_launch_trial.h" #include "chrome/browser/google/google_brand.h" #include "chrome/browser/prerender/prerender_field_trial.h" -#include "chrome/browser/profiles/profiles_state.h" -#include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h" #include "chrome/common/chrome_switches.h" -#include "chrome/common/chrome_version_info.h" #include "chrome/common/variations/variations_util.h" #include "components/variations/variations_associated_data.h" -#include "content/public/common/content_constants.h" -#include "net/spdy/spdy_session.h" -#include "ui/base/layout.h" namespace chrome { @@ -40,27 +33,6 @@ void AutoLaunchChromeFieldTrial() { } } -void SetupInfiniteCacheFieldTrial() { - const base::FieldTrial::Probability kDivisor = 100; - - base::FieldTrial::Probability infinite_cache_probability = 0; - - scoped_refptr<base::FieldTrial> trial( - base::FieldTrialList::FactoryGetFieldTrial( - "InfiniteCache", kDivisor, "No", 2013, 12, 31, - base::FieldTrial::ONE_TIME_RANDOMIZED, NULL)); - trial->AppendGroup("Yes", infinite_cache_probability); - trial->AppendGroup("Control", infinite_cache_probability); -} - -void DisableShowProfileSwitcherTrialIfNecessary() { - // This trial is created by the VariationsService, but it needs to be disabled - // if multi-profiles isn't enabled. - base::FieldTrial* trial = base::FieldTrialList::Find("ShowProfileSwitcher"); - if (trial && !profiles::IsMultipleProfilesEnabled()) - trial->Disable(); -} - void SetupLightSpeedTrials() { if (!variations::GetVariationParamValue("LightSpeed", "NoGpu").empty()) { base::CommandLine::ForCurrentProcess()->AppendSwitch( @@ -73,8 +45,6 @@ void SetupLightSpeedTrials() { void SetupDesktopFieldTrials(const base::CommandLine& parsed_command_line) { prerender::ConfigurePrerender(parsed_command_line); AutoLaunchChromeFieldTrial(); - SetupInfiniteCacheFieldTrial(); - DisableShowProfileSwitcherTrialIfNecessary(); SetupLightSpeedTrials(); } diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc index fb50340..cbb01f0 100644 --- a/chrome/browser/chrome_browser_main.cc +++ b/chrome/browser/chrome_browser_main.cc @@ -651,8 +651,7 @@ void ChromeBrowserMainParts::SetupMetricsAndFieldTrials() { variations_service->CreateTrialsFromSeed(); // This must be called after |local_state_| is initialized. - browser_field_trials_.SetupFieldTrials( - base::Time::FromTimeT(metrics->GetInstallDate())); + browser_field_trials_.SetupFieldTrials(); // Initialize FieldTrialSynchronizer system. This is a singleton and is used // for posting tasks via base::Bind. Its deleted when it goes out of scope. diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc index 535d3c8..39454b6 100644 --- a/chrome/browser/profiles/profile_impl.cc +++ b/chrome/browser/profiles/profile_impl.cc @@ -619,10 +619,6 @@ void ProfileImpl::DoFinalInit() { extensions_cookie_path = extensions_cookie_path.Append(chrome::kExtensionsCookieFilename); - base::FilePath infinite_cache_path = GetPath(); - infinite_cache_path = - infinite_cache_path.Append(FILE_PATH_LITERAL("Infinite Cache")); - #if defined(OS_ANDROID) SessionStartupPref::Type startup_pref_type = SessionStartupPref::GetDefaultStartupType(); @@ -643,8 +639,8 @@ void ProfileImpl::DoFinalInit() { io_data_.Init(cookie_path, channel_id_path, cache_path, cache_max_size, media_cache_path, media_cache_max_size, - extensions_cookie_path, GetPath(), infinite_cache_path, - predictor_, session_cookie_mode, GetSpecialStoragePolicy(), + extensions_cookie_path, GetPath(), predictor_, + session_cookie_mode, GetSpecialStoragePolicy(), CreateDomainReliabilityMonitor(local_state)); #if defined(ENABLE_PLUGINS) diff --git a/chrome/browser/profiles/profile_impl_io_data.cc b/chrome/browser/profiles/profile_impl_io_data.cc index d64039e..ae9af75 100644 --- a/chrome/browser/profiles/profile_impl_io_data.cc +++ b/chrome/browser/profiles/profile_impl_io_data.cc @@ -145,7 +145,6 @@ void ProfileImplIOData::Handle::Init( int media_cache_max_size, const base::FilePath& extensions_cookie_path, const base::FilePath& profile_path, - const base::FilePath& infinite_cache_path, chrome_browser_net::Predictor* predictor, content::CookieStoreConfig::SessionCookieMode session_cookie_mode, storage::SpecialStoragePolicy* special_storage_policy, @@ -164,7 +163,6 @@ void ProfileImplIOData::Handle::Init( lazy_params->media_cache_path = media_cache_path; lazy_params->media_cache_max_size = media_cache_max_size; lazy_params->extensions_cookie_path = extensions_cookie_path; - lazy_params->infinite_cache_path = infinite_cache_path; lazy_params->session_cookie_mode = session_cookie_mode; lazy_params->special_storage_policy = special_storage_policy; @@ -575,8 +573,6 @@ void ProfileImplIOData::InitializeInternal( FROM_HERE_WITH_EXPLICIT_FUNCTION( "436671 ProfileImplIOData::InitializeInternal71")); - main_cache->InitializeInfiniteCache(lazy_params_->infinite_cache_path); - main_http_factory_.reset(main_cache.release()); main_context->set_http_transaction_factory(main_http_factory_.get()); diff --git a/chrome/browser/profiles/profile_impl_io_data.h b/chrome/browser/profiles/profile_impl_io_data.h index 02a3d23..1eca955 100644 --- a/chrome/browser/profiles/profile_impl_io_data.h +++ b/chrome/browser/profiles/profile_impl_io_data.h @@ -62,7 +62,6 @@ class ProfileImplIOData : public ProfileIOData { int media_cache_max_size, const base::FilePath& extensions_cookie_path, const base::FilePath& profile_path, - const base::FilePath& infinite_cache_path, chrome_browser_net::Predictor* predictor, content::CookieStoreConfig::SessionCookieMode session_cookie_mode, storage::SpecialStoragePolicy* special_storage_policy, @@ -162,7 +161,6 @@ class ProfileImplIOData : public ProfileIOData { base::FilePath media_cache_path; int media_cache_max_size; base::FilePath extensions_cookie_path; - base::FilePath infinite_cache_path; content::CookieStoreConfig::SessionCookieMode session_cookie_mode; scoped_refptr<storage::SpecialStoragePolicy> special_storage_policy; }; diff --git a/net/http/http_cache.cc b/net/http/http_cache.cc index dc6f516..cef2928 100644 --- a/net/http/http_cache.cc +++ b/net/http/http_cache.cc @@ -56,11 +56,6 @@ bool UseCertCache() { "ExperimentGroup"; } -// Adaptor to delete a file on a worker thread. -void DeletePath(base::FilePath path) { - base::DeleteFile(path, false); -} - } // namespace namespace net { @@ -623,12 +618,6 @@ void HttpCache::OnExternalCacheHit(const GURL& url, disk_cache_->OnExternalCacheHit(key); } -void HttpCache::InitializeInfiniteCache(const base::FilePath& path) { - if (base::FieldTrialList::FindFullName("InfiniteCache") != "Yes") - return; - base::WorkerPool::PostTask(FROM_HERE, base::Bind(&DeletePath, path), true); -} - int HttpCache::CreateTransaction(RequestPriority priority, scoped_ptr<HttpTransaction>* trans) { // Do lazy initialization of disk cache if needed. diff --git a/net/http/http_cache.h b/net/http/http_cache.h index e459475..8f48c2a 100644 --- a/net/http/http_cache.h +++ b/net/http/http_cache.h @@ -199,9 +199,6 @@ class NET_EXPORT HttpCache : public HttpTransactionFactory, // referred to by |url| and |http_method|. void OnExternalCacheHit(const GURL& url, const std::string& http_method); - // Initializes the Infinite Cache, if selected by the field trial. - void InitializeInfiniteCache(const base::FilePath& path); - // Causes all transactions created after this point to effectively bypass // the cache lock whenever there is lock contention. void BypassLockForTest() { |