Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(247)

Unified Diff: content/browser/appcache/appcache_disk_cache.cc

Issue 1140853002: ServiceWorker: Use SimpleCache for the script cache (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix build failure on android Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/appcache/appcache_disk_cache.cc
diff --git a/content/browser/appcache/appcache_disk_cache.cc b/content/browser/appcache/appcache_disk_cache.cc
index 382ed45fed2197ae8be5b861e1f310d18a118694..082b2d3547deae743e89738d9cbc97b3b2c98a34 100644
--- a/content/browser/appcache/appcache_disk_cache.cc
+++ b/content/browser/appcache/appcache_disk_cache.cc
@@ -178,6 +178,9 @@ class AppCacheDiskCache::ActiveCall {
AppCacheDiskCache::AppCacheDiskCache()
: is_disabled_(false) {
+#if defined(APPCACHE_USE_SIMPLE_CACHE)
+ use_simple_cache_ = true;
michaeln 2015/05/14 23:35:26 nit: initializer list instead of the method body
nhiroki 2015/05/15 02:12:51 Done.
+#endif
}
AppCacheDiskCache::~AppCacheDiskCache() {
@@ -310,14 +313,10 @@ int AppCacheDiskCache::Init(
is_disabled_ = false;
create_backend_callback_ = new CreateBackendCallbackShim(this);
-#if defined(APPCACHE_USE_SIMPLE_CACHE)
- const net::BackendType backend_type = net::CACHE_BACKEND_SIMPLE;
-#else
- const net::BackendType backend_type = net::CACHE_BACKEND_DEFAULT;
-#endif
int rv = disk_cache::CreateCacheBackend(
cache_type,
- backend_type,
+ use_simple_cache_ ? net::CACHE_BACKEND_SIMPLE
+ : net::CACHE_BACKEND_DEFAULT,
cache_directory,
cache_size,
force,

Powered by Google App Engine
This is Rietveld 408576698