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

Unified Diff: net/disk_cache/cache_creator.cc

Issue 13731002: Cache Backend Proxy to intercept all cache events from the IO thread. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: trivial net.gyp merge Created 7 years, 8 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
« no previous file with comments | « net/disk_cache/backend_unittest.cc ('k') | net/disk_cache/disk_cache_test_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/cache_creator.cc
diff --git a/net/disk_cache/cache_creator.cc b/net/disk_cache/cache_creator.cc
index 9a3a924a7f5a29bde5796597337141310145c061..c2c901f5f61e76507dcd97b8953c0c475e83b666 100644
--- a/net/disk_cache/cache_creator.cc
+++ b/net/disk_cache/cache_creator.cc
@@ -11,6 +11,10 @@
#include "net/disk_cache/mem_backend_impl.h"
#include "net/disk_cache/simple/simple_backend_impl.h"
+#ifdef USE_TRACING_CACHE_BACKEND
+#include "net/disk_cache/tracing_cache_backend.h"
+#endif
+
namespace {
// Builds an instance of the backend depending on platform, type, experiments
@@ -102,9 +106,13 @@ int CacheCreator::Run() {
void CacheCreator::DoCallback(int result) {
DCHECK_NE(net::ERR_IO_PENDING, result);
- if (result == net::OK)
+ if (result == net::OK) {
+#ifndef USE_TRACING_CACHE_BACKEND
*backend_ = created_cache_;
- else {
+#else
+ *backend_ = new disk_cache::TracingCacheBackend(created_cache_);
+#endif
+ } else {
LOG(ERROR) << "Unable to create cache";
*backend_ = NULL;
delete created_cache_;
« no previous file with comments | « net/disk_cache/backend_unittest.cc ('k') | net/disk_cache/disk_cache_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698