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

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

Issue 1155063002: ServiceWorker: Introduce ServiceWorkerDiskCacheMigrator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add DCHECKs 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 46f406eb6997c6815c25cd69fe669cae45799950..03d348c76bba246197ddaddad410ffccb63caa49 100644
--- a/content/browser/appcache/appcache_disk_cache.cc
+++ b/content/browser/appcache/appcache_disk_cache.cc
@@ -198,8 +198,12 @@ class AppCacheDiskCache::ActiveCall
};
AppCacheDiskCache::AppCacheDiskCache()
- : is_disabled_(false),
- weak_factory_(this) {
+#if defined(APPCACHE_USE_SIMPLE_CACHE)
+ : AppCacheDiskCache(true)
+#else
+ : AppCacheDiskCache(false)
+#endif
+{
}
AppCacheDiskCache::~AppCacheDiskCache() {
@@ -304,6 +308,12 @@ int AppCacheDiskCache::DoomEntry(int64 key,
return ActiveCall::DoomEntry(weak_factory_.GetWeakPtr(), key, callback);
}
+AppCacheDiskCache::AppCacheDiskCache(bool use_simple_cache)
+ : use_simple_cache_(use_simple_cache),
+ is_disabled_(false),
+ weak_factory_(this) {
+}
+
AppCacheDiskCache::PendingCall::PendingCall()
: call_type(CREATE),
key(0),
@@ -333,14 +343,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,
« no previous file with comments | « content/browser/appcache/appcache_disk_cache.h ('k') | content/browser/service_worker/service_worker_disk_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698