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

Unified Diff: net/disk_cache/simple/simple_backend_impl.h

Issue 13813015: Separate Simple Backend creation from initialization. (Closed) Base URL: http://git.chromium.org/chromium/src.git@trace-2
Patch Set: updated the simple backend initialization according to the new interface in tests 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
Index: net/disk_cache/simple/simple_backend_impl.h
diff --git a/net/disk_cache/simple/simple_backend_impl.h b/net/disk_cache/simple/simple_backend_impl.h
index 99a01d8f9f862d6a50ed2d3ea2074d0ffdf62d76..0c7ba8cf8cb762991f178e97eb60bf0fcbf78dfd 100644
--- a/net/disk_cache/simple/simple_backend_impl.h
+++ b/net/disk_cache/simple/simple_backend_impl.h
@@ -29,16 +29,14 @@ class SimpleIndex;
class NET_EXPORT_PRIVATE SimpleBackendImpl : public Backend {
public:
- virtual ~SimpleBackendImpl();
+ SimpleBackendImpl(const base::FilePath& path, int max_bytes,
+ net::CacheType type,
+ const scoped_refptr<base::TaskRunner>& cache_thread,
+ net::NetLog* net_log);
+
+ int Init(const CompletionCallback& callback);
- static int CreateBackend(const base::FilePath& full_path,
- int max_bytes,
- net::CacheType type,
- uint32 flags,
- scoped_refptr<base::TaskRunner> cache_thread,
- net::NetLog* net_log,
- Backend** backend,
- const CompletionCallback& callback);
+ virtual ~SimpleBackendImpl();
// From Backend:
virtual net::CacheType GetCacheType() const OVERRIDE;
@@ -63,25 +61,14 @@ class NET_EXPORT_PRIVATE SimpleBackendImpl : public Backend {
virtual void OnExternalCacheHit(const std::string& key) OVERRIDE;
private:
- SimpleBackendImpl(
- const scoped_refptr<base::TaskRunner>& cache_thread,
- const base::FilePath& path);
-
- // Creates the Cache directory if needed. Performs blocking IO, so it cannot
- // be called on IO thread.
- static void EnsureCachePathExists(
- const base::FilePath& path,
- const scoped_refptr<base::TaskRunner>& cache_thread,
- const scoped_refptr<base::TaskRunner>& io_thread,
- const CompletionCallback& callback,
- Backend** backend);
-
// Must run on Cache Thread.
- void Initialize();
+ void InitializeIndex(base::MessageLoopProxy* io_thread,
+ const CompletionCallback& callback);
const base::FilePath path_;
scoped_ptr<SimpleIndex> index_;
+ const scoped_refptr<base::TaskRunner> cache_thread_;
};
} // namespace disk_cache

Powered by Google App Engine
This is Rietveld 408576698