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

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: 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..4981ce7b2a8e0c82a88375099721161f8aabc038 100644
--- a/net/disk_cache/simple/simple_backend_impl.h
+++ b/net/disk_cache/simple/simple_backend_impl.h
@@ -29,16 +29,12 @@ 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);
- 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);
+ int Init(const CompletionCallback& callback);
// From Backend:
virtual net::CacheType GetCacheType() const OVERRIDE;
@@ -63,25 +59,16 @@ 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);
+ virtual ~SimpleBackendImpl();
gavinp 2013/04/09 16:03:49 This is weird: why redeclare the destructor as pri
pasko-google - do not use 2013/04/09 16:20:48 Moved back.
// 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