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

Unified Diff: chrome/browser/chromeos/drive/file_cache.h

Issue 17249004: drive: Use ResourceMetadataStorage from FileCache (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More precise old DB handling Created 7 years, 6 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: chrome/browser/chromeos/drive/file_cache.h
diff --git a/chrome/browser/chromeos/drive/file_cache.h b/chrome/browser/chromeos/drive/file_cache.h
index 125df5791b89856109085136fffebe0b2e3319be..e4afd4bbe2afd7e907d0d3e77e20cac26f733274 100644
--- a/chrome/browser/chromeos/drive/file_cache.h
+++ b/chrome/browser/chromeos/drive/file_cache.h
@@ -41,7 +41,7 @@ typedef base::Callback<void(const std::string& resource_id,
namespace internal {
-class FileCacheMetadata;
+class ResourceMetadataStorage;
// Callback for GetFileFromCache.
typedef base::Callback<void(FileError error,
@@ -74,8 +74,11 @@ class FileCache {
FILE_OPERATION_COPY,
};
- // |metadata_directory| stores the metadata and |cache_file_directory| stores
- // cached files.
+ // Name of the cache metadata DB previously used.
+ // TODO(hashimoto): Remove this at some point.
+ static const base::FilePath::CharType kOldCacheMetadataDBName[];
+
+ // |cache_file_directory| stores cached files.
//
// |blocking_task_runner| is used to post a task to the blocking worker
// pool for file operations. Must not be null.
@@ -84,7 +87,7 @@ class FileCache {
// getter for testing. NULL must be passed for production code.
//
// Must be called on the UI thread.
- FileCache(const base::FilePath& metadata_directory,
+ FileCache(ResourceMetadataStorage* storage,
const base::FilePath& cache_file_directory,
base::SequencedTaskRunner* blocking_task_runner,
FreeDiskSpaceGetterInterface* free_disk_space_getter);
@@ -294,15 +297,14 @@ class FileCache {
bool HasEnoughSpaceFor(int64 num_bytes, const base::FilePath& path);
// Imports old format DB from |old_db_path| and deletes it.
- void ImportOldDB(const base::FilePath& old_db_path);
+ // TODO(hashimoto): Remove this method and FileCacheMetadata at some point.
+ bool ImportOldDB(const base::FilePath& old_db_path);
- const base::FilePath metadata_directory_;
const base::FilePath cache_file_directory_;
scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_;
- // The cache state data. This member must be access only on the blocking pool.
- scoped_ptr<FileCacheMetadata> metadata_;
+ ResourceMetadataStorage* storage_;
FreeDiskSpaceGetterInterface* free_disk_space_getter_; // Not owned.
« no previous file with comments | « chrome/browser/chromeos/drive/drive_integration_service.cc ('k') | chrome/browser/chromeos/drive/file_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698