diff options
author | hashimoto@chromium.org <hashimoto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-14 06:25:45 +0000 |
---|---|---|
committer | hashimoto@chromium.org <hashimoto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-14 06:25:45 +0000 |
commit | 9d147586a54d556e6692141572764646ee09a166 (patch) | |
tree | 32478dd59ba994f1fd4c3120593ab06f93122a7b /chrome/browser/chromeos/drive/file_cache.h | |
parent | 4d9b083160466cee96855a80318a904b7c89eec7 (diff) | |
download | chromium_src-9d147586a54d556e6692141572764646ee09a166.zip chromium_src-9d147586a54d556e6692141572764646ee09a166.tar.gz chromium_src-9d147586a54d556e6692141572764646ee09a166.tar.bz2 |
drive: Merge 'persistent' and 'tmp' directories to 'files'
Remove FileCacheEntry::is_present which can be replaced with "is_pinned() || is_dirty() || is_mounted()".
Stop moving files between the two directories when modifying cache states.
Add FileCache::MigrateFilesFromOldDirectories().
BUG=248905
TEST=unit_tests
R=kinaba@chromium.org, satorux@chromium.org
Review URL: https://codereview.chromium.org/15663006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@206326 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/drive/file_cache.h')
-rw-r--r-- | chrome/browser/chromeos/drive/file_cache.h | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/chrome/browser/chromeos/drive/file_cache.h b/chrome/browser/chromeos/drive/file_cache.h index 24b876a..bddeb16 100644 --- a/chrome/browser/chromeos/drive/file_cache.h +++ b/chrome/browser/chromeos/drive/file_cache.h @@ -71,10 +71,7 @@ class FileCache { // This indexes into |FileCache::cache_paths_| vector. enum CacheSubDirectoryType { CACHE_TYPE_META = 0, // Resource metadata. - CACHE_TYPE_PERSISTENT, // Files that are pinned or modified locally, - // not evictable, hopefully. - CACHE_TYPE_TMP, // Files that don't meet criteria to be in - // persistent dir, and hence evictable. + CACHE_TYPE_FILES, // Cached files. CACHE_TYPE_TMP_DOWNLOADS, // Downloaded files. CACHE_TYPE_TMP_DOCUMENTS, // Temporary JSON files for hosted documents. NUM_CACHE_TYPES, // This must be at the end. @@ -279,10 +276,6 @@ class FileCache { static bool CreateCacheDirectories( const std::vector<base::FilePath>& paths_to_create); - // Returns the type of the sub directory where the cache file is stored. - static CacheSubDirectoryType GetSubDirectoryType( - const FileCacheEntry& cache_entry); - private: friend class FileCacheTest; friend class FileCacheTestOnUIThread; @@ -301,7 +294,6 @@ class FileCache { // Can be called on any thread. base::FilePath GetCacheFilePath(const std::string& resource_id, const std::string& md5, - CacheSubDirectoryType sub_dir_type, CachedFileOrigin file_origin) const; @@ -315,6 +307,11 @@ class FileCache { // Destroys the cache on the blocking pool. void DestroyOnBlockingPool(); + // Migrates files from old "persistent" and "tmp" directories to the new + // "files" directory (see crbug.com/248905). + // TODO(hashimoto): Remove this method at some point. + void MigrateFilesFromOldDirectories(); + // Used to implement Store and StoreLocallyModifiedOnUIThread. // TODO(hidehiko): Merge this method with Store(), after // StoreLocallyModifiedOnUIThread is removed. |