diff options
author | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-07 02:27:23 +0000 |
---|---|---|
committer | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-07 02:27:23 +0000 |
commit | cfc076ec466fc48e91c309448c4e5be3467b42c7 (patch) | |
tree | 721e6d222b9ce7411d4d925cdd7de7d06d9d65e4 /chrome | |
parent | 09fe9499ec1cb0d327a03e433022cb8603a16933 (diff) | |
download | chromium_src-cfc076ec466fc48e91c309448c4e5be3467b42c7.zip chromium_src-cfc076ec466fc48e91c309448c4e5be3467b42c7.tar.gz chromium_src-cfc076ec466fc48e91c309448c4e5be3467b42c7.tar.bz2 |
Clear disk cache when the cache is not initialized
BUG=24765
TEST=unit test, clear browsing data and the cache, media cache will
be cleared even if a media object was not loaded.
Since the disk cache backend in HttpCache is lazily initialized, clearing
the cache before it receives the first transaction would have no effect.
So initialize the disk cache explicitly when we clear the cache.
Review URL: http://codereview.chromium.org/378015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31361 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/browsing_data_remover.cc | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/chrome/browser/browsing_data_remover.cc b/chrome/browser/browsing_data_remover.cc index 0a646fa..4477ce7 100644 --- a/chrome/browser/browsing_data_remover.cc +++ b/chrome/browser/browsing_data_remover.cc @@ -240,10 +240,9 @@ void BrowsingDataRemover::ClearCacheOnIOThread( // Get a pointer to the cache. net::HttpTransactionFactory* factory = main_context_getter->GetURLRequestContext()->http_transaction_factory(); - disk_cache::Backend* cache = factory->GetCache()->disk_cache(); + disk_cache::Backend* cache = factory->GetCache()->GetBackend(); - // |cache| can be null since it is lazily initialized, in this case we do - // nothing. + // |cache| can be null if it cannot be initialized. if (cache) { if (delete_begin.is_null()) cache->DoomAllEntries(); @@ -254,10 +253,9 @@ void BrowsingDataRemover::ClearCacheOnIOThread( // Get a pointer to the media cache. factory = media_context_getter->GetURLRequestContext()-> http_transaction_factory(); - cache = factory->GetCache()->disk_cache(); + cache = factory->GetCache()->GetBackend(); - // |cache| can be null since it is lazily initialized, in this case we do - // nothing. + // |cache| can be null if it cannot be initialized. if (cache) { if (delete_begin.is_null()) cache->DoomAllEntries(); |