summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authormichaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-17 22:02:28 +0000
committermichaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-17 22:02:28 +0000
commitfd2885ab79962663f474a39b13cfbfdb4827534e (patch)
tree1ce0e0967d005178a64cf0d4a7e11e16a76fd3d8 /net
parent9348c1f762db498d399d07c0295e36d75ee7fa08 (diff)
downloadchromium_src-fd2885ab79962663f474a39b13cfbfdb4827534e.zip
chromium_src-fd2885ab79962663f474a39b13cfbfdb4827534e.tar.gz
chromium_src-fd2885ab79962663f474a39b13cfbfdb4827534e.tar.bz2
AppCache: Migrate to the DiskCache's async interface and use the CacheType::APP_CACHE value.
BUG=38273 TEST=existing layout tests and unit tests apply Review URL: http://codereview.chromium.org/886003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41884 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/disk_cache/backend_impl.cc10
-rw-r--r--net/disk_cache/histogram_macros.h3
2 files changed, 13 insertions, 0 deletions
diff --git a/net/disk_cache/backend_impl.cc b/net/disk_cache/backend_impl.cc
index 194a74e..534c33f 100644
--- a/net/disk_cache/backend_impl.cc
+++ b/net/disk_cache/backend_impl.cc
@@ -173,6 +173,16 @@ Backend* CreateCacheBackend(const FilePath& full_path, bool force,
return BackendImpl::CreateBackend(full_path, force, max_bytes, type, kNone);
}
+int CreateCacheBackend(net::CacheType type, const FilePath& path, int max_bytes,
+ bool force, Backend** backend,
+ CompletionCallback* callback) {
+ if (type == net::MEMORY_CACHE)
+ *backend = CreateInMemoryCacheBackend(max_bytes);
+ else
+ *backend = BackendImpl::CreateBackend(path, force, max_bytes, type, kNone);
+ return *backend ? net::OK : net::ERR_FAILED;
+}
+
int PreferedCacheSize(int64 available) {
// If there is not enough space to use kDefaultCacheSize, use 80% of the
// available space.
diff --git a/net/disk_cache/histogram_macros.h b/net/disk_cache/histogram_macros.h
index 27610f5..8d5966c 100644
--- a/net/disk_cache/histogram_macros.h
+++ b/net/disk_cache/histogram_macros.h
@@ -53,6 +53,9 @@
case net::MEDIA_CACHE:\
UMA_HISTOGRAM_##type(my_name.data(), sample);\
break;\
+ case net::APP_CACHE:\
+ UMA_HISTOGRAM_##type(my_name.data(), sample);\
+ break;\
default:\
NOTREACHED();\
break;\