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

Unified Diff: net/disk_cache/backend_impl.cc

Issue 12192005: Add new simple disk cache backend. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix dcheck Created 7 years, 10 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: net/disk_cache/backend_impl.cc
diff --git a/net/disk_cache/backend_impl.cc b/net/disk_cache/backend_impl.cc
index 232b3f8b295ee2ad0580b47deb9bbbcf9898bda5..104032faae9b4c59c6918d8ae886e8429e32a7c7 100644
--- a/net/disk_cache/backend_impl.cc
+++ b/net/disk_cache/backend_impl.cc
@@ -28,6 +28,7 @@
#include "net/disk_cache/experiments.h"
#include "net/disk_cache/file.h"
#include "net/disk_cache/mem_backend_impl.h"
+#include "net/disk_cache/simple/simple_backend_impl.h"
// This has to be defined before including histogram_macros.h from this file.
#define NET_DISK_CACHE_BACKEND_IMPL_CC_
@@ -262,6 +263,7 @@ int CreateCacheBackend(net::CacheType type, const base::FilePath& path,
bool force, base::MessageLoopProxy* thread,
net::NetLog* net_log, Backend** backend,
const net::CompletionCallback& callback) {
+ // TODO(pasko): Separate out cache creation when landing cache tracer.
DCHECK(!callback.is_null());
if (type == net::MEMORY_CACHE) {
*backend = MemBackendImpl::CreateBackend(max_bytes, net_log);
@@ -269,8 +271,13 @@ int CreateCacheBackend(net::CacheType type, const base::FilePath& path,
}
DCHECK(thread);
+#if defined(USE_SIMPLE_BACKEND)
felipeg 2013/02/12 13:25:20 SIMPLE_BACKEND is too generic when defining in the
gavinp 2013/02/12 15:45:57 Done.
+ return SimpleBackendImpl::CreateBackend(path, force, max_bytes, type, kNone,
+ thread, net_log, backend, callback);
+#else
return BackendImpl::CreateBackend(path, force, max_bytes, type, kNone, thread,
net_log, backend, callback);
+#endif
}
// Returns the preferred maximum number of bytes for the cache given the
« no previous file with comments | « no previous file | net/disk_cache/simple/simple_backend_impl.h » ('j') | net/disk_cache/simple/simple_backend_impl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698