summaryrefslogtreecommitdiffstats
path: root/net/http
diff options
context:
space:
mode:
authortony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-15 23:40:15 +0000
committertony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-15 23:40:15 +0000
commit88fb4ada915e7f37a6ac939c10ef0ff96889dc71 (patch)
treee7457fbdbde126435002d6e29d1c7d1565d19ec7 /net/http
parentbd18902708017f8b22ed9a4c6e9b3e1b130f2a4c (diff)
downloadchromium_src-88fb4ada915e7f37a6ac939c10ef0ff96889dc71.zip
chromium_src-88fb4ada915e7f37a6ac939c10ef0ff96889dc71.tar.gz
chromium_src-88fb4ada915e7f37a6ac939c10ef0ff96889dc71.tar.bz2
Convert the HTTP cache to use FilePath rather than wstring for the
disk cache path. BUG=24672 Review URL: http://codereview.chromium.org/276048 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29213 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http')
-rw-r--r--net/http/http_cache.cc11
-rw-r--r--net/http/http_cache.h7
2 files changed, 9 insertions, 9 deletions
diff --git a/net/http/http_cache.cc b/net/http/http_cache.cc
index 86544c6..ded4565 100644
--- a/net/http/http_cache.cc
+++ b/net/http/http_cache.cc
@@ -1589,7 +1589,7 @@ void HttpCache::Transaction::OnCacheEntryReady(int result) {
HttpCache::HttpCache(HostResolver* host_resolver,
ProxyService* proxy_service,
SSLConfigService* ssl_config_service,
- const std::wstring& cache_dir,
+ const FilePath& cache_dir,
int cache_size)
: disk_cache_dir_(cache_dir),
mode_(NORMAL),
@@ -1603,7 +1603,7 @@ HttpCache::HttpCache(HostResolver* host_resolver,
}
HttpCache::HttpCache(HttpNetworkSession* session,
- const std::wstring& cache_dir,
+ const FilePath& cache_dir,
int cache_size)
: disk_cache_dir_(cache_dir),
mode_(NORMAL),
@@ -1670,10 +1670,9 @@ int HttpCache::CreateTransaction(scoped_ptr<HttpTransaction>* trans) {
// was an in-memory cache.
disk_cache_.reset(disk_cache::CreateInMemoryCacheBackend(cache_size_));
} else if (!disk_cache_dir_.empty()) {
- disk_cache_.reset(disk_cache::CreateCacheBackend(
- FilePath::FromWStringHack(disk_cache_dir_), true, cache_size_,
- type_));
- disk_cache_dir_.clear(); // Reclaim memory.
+ disk_cache_.reset(disk_cache::CreateCacheBackend(disk_cache_dir_, true,
+ cache_size_, type_));
+ disk_cache_dir_ = FilePath(); // Reclaim memory.
}
}
trans->reset(new HttpCache::Transaction(this, enable_range_support_));
diff --git a/net/http/http_cache.h b/net/http/http_cache.h
index 35d16c6..fe77912 100644
--- a/net/http/http_cache.h
+++ b/net/http/http_cache.h
@@ -18,6 +18,7 @@
#include <set>
#include "base/basictypes.h"
+#include "base/file_path.h"
#include "base/hash_tables.h"
#include "base/scoped_ptr.h"
#include "base/task.h"
@@ -64,7 +65,7 @@ class HttpCache : public HttpTransactionFactory,
HttpCache(HostResolver* host_resolver,
ProxyService* proxy_service,
SSLConfigService* ssl_config_service,
- const std::wstring& cache_dir,
+ const FilePath& cache_dir,
int cache_size);
// Initialize the cache from the directory where its data is stored. The
@@ -73,7 +74,7 @@ class HttpCache : public HttpTransactionFactory,
// Provide an existing HttpNetworkSession, the cache can construct a
// network layer with a shared HttpNetworkSession in order for multiple
// network layers to share information (e.g. authenication data).
- HttpCache(HttpNetworkSession* session, const std::wstring& cache_dir,
+ HttpCache(HttpNetworkSession* session, const FilePath& cache_dir,
int cache_size);
// Initialize using an in-memory cache. The cache is initialized lazily
@@ -186,7 +187,7 @@ class HttpCache : public HttpTransactionFactory,
// Variables ----------------------------------------------------------------
// used when lazily constructing the disk_cache_
- std::wstring disk_cache_dir_;
+ FilePath disk_cache_dir_;
Mode mode_;
CacheType type_;