diff options
author | rvargas@chromium.org <rvargas@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-30 17:49:48 +0000 |
---|---|---|
committer | rvargas@chromium.org <rvargas@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-30 17:49:48 +0000 |
commit | b851da9d3d378df04225d39ea44502742c73c20f (patch) | |
tree | 75926f3dd54b06e16f8fd97a856aed89ab3e8817 /net/http/http_cache.cc | |
parent | 6042bccc5aa73335796043eb35a5f2a76f3addf1 (diff) | |
download | chromium_src-b851da9d3d378df04225d39ea44502742c73c20f.zip chromium_src-b851da9d3d378df04225d39ea44502742c73c20f.tar.gz chromium_src-b851da9d3d378df04225d39ea44502742c73c20f.tar.bz2 |
Http cache: disable the infinite cache simulation and perform cleanup of local data.
BUG=147383
TEST=none
Review URL: https://chromiumcodereview.appspot.com/13000003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@191528 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_cache.cc')
-rw-r--r-- | net/http/http_cache.cc | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/net/http/http_cache.cc b/net/http/http_cache.cc index ab9a0bb..a2a9dfc 100644 --- a/net/http/http_cache.cc +++ b/net/http/http_cache.cc @@ -15,6 +15,7 @@ #include "base/bind.h" #include "base/bind_helpers.h" #include "base/callback.h" +#include "base/file_util.h" #include "base/format_macros.h" #include "base/location.h" #include "base/memory/ref_counted.h" @@ -25,6 +26,7 @@ #include "base/string_number_conversions.h" #include "base/string_util.h" #include "base/stringprintf.h" +#include "base/threading/worker_pool.h" #include "net/base/io_buffer.h" #include "net/base/load_flags.h" #include "net/base/net_errors.h" @@ -38,6 +40,15 @@ #include "net/http/http_response_info.h" #include "net/http/http_util.h" +namespace { + +// Adaptor to delete a file on a worker thread. +void DeletePath(base::FilePath path) { + file_util::Delete(path, false); +} + +} // namespace + namespace net { HttpCache::DefaultBackend::DefaultBackend(CacheType type, @@ -356,7 +367,7 @@ void HttpCache::WriteMetadata(const GURL& url, } HttpCache::Transaction* trans = - new HttpCache::Transaction(priority, this, NULL, NULL); + new HttpCache::Transaction(priority, this, NULL); MetadataWriter* writer = new MetadataWriter(trans); // The writer will self destruct when done. @@ -394,8 +405,7 @@ void HttpCache::OnExternalCacheHit(const GURL& url, void HttpCache::InitializeInfiniteCache(const base::FilePath& path) { if (base::FieldTrialList::FindFullName("InfiniteCache") != "Yes") return; - // To be enabled after everything is fully wired. - infinite_cache_.Init(path); + base::WorkerPool::PostTask(FROM_HERE, base::Bind(&DeletePath, path), true); } int HttpCache::CreateTransaction(RequestPriority priority, @@ -407,10 +417,7 @@ int HttpCache::CreateTransaction(RequestPriority priority, CreateBackend(NULL, net::CompletionCallback()); } - InfiniteCacheTransaction* infinite_cache_transaction = - infinite_cache_.CreateInfiniteCacheTransaction(); - trans->reset(new HttpCache::Transaction(priority, this, delegate, - infinite_cache_transaction)); + trans->reset(new HttpCache::Transaction(priority, this, delegate)); return OK; } |