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

Unified Diff: chrome/browser/chromeos/gdata/gdata_cache.cc

Issue 10735049: gdata: Take GDataCache::CacheEntry as parameters (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: polish Created 8 years, 5 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 | « chrome/browser/chromeos/gdata/gdata_cache.h ('k') | chrome/browser/chromeos/gdata/gdata_cache_metadata.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/gdata/gdata_cache.cc
diff --git a/chrome/browser/chromeos/gdata/gdata_cache.cc b/chrome/browser/chromeos/gdata/gdata_cache.cc
index 3d13b7c2012321bb187fda5517595380240a195c..1b75e69ceec3549438ef28e1d1bf63b07c5c492b 100644
--- a/chrome/browser/chromeos/gdata/gdata_cache.cc
+++ b/chrome/browser/chromeos/gdata/gdata_cache.cc
@@ -881,9 +881,8 @@ void GDataCache::Store(const std::string& resource_id,
if (*error == base::PLATFORM_FILE_OK) {
// Now that file operations have completed, update cache map.
UpdateCacheWithSubDirectoryType(resource_id,
- md5,
sub_dir_type,
- cache_state);
+ CacheEntry(md5, cache_state));
}
}
@@ -971,9 +970,8 @@ void GDataCache::Pin(const std::string& resource_id,
if (*error == base::PLATFORM_FILE_OK) {
// Now that file operations have completed, update cache map.
UpdateCacheWithSubDirectoryType(resource_id,
- md5,
sub_dir_type,
- cache_state);
+ CacheEntry(md5, cache_state));
}
}
@@ -1053,9 +1051,8 @@ void GDataCache::Unpin(const std::string& resource_id,
// Now that file operations have completed, update cache map.
int cache_state = ClearCachePinned(cache_entry->cache_state);
UpdateCacheWithSubDirectoryType(resource_id,
- md5,
sub_dir_type,
- cache_state);
+ CacheEntry(md5, cache_state));
}
}
@@ -1120,9 +1117,8 @@ void GDataCache::SetMountedState(const FilePath& file_path,
if (*error == base::PLATFORM_FILE_OK) {
// Now that cache operation is complete, update cache map
UpdateCacheWithSubDirectoryType(resource_id,
- md5,
dest_subdir,
- cache_state);
+ CacheEntry(md5, cache_state));
}
}
@@ -1226,9 +1222,8 @@ void GDataCache::MarkDirty(const std::string& resource_id,
// Now that file operations have completed, update cache map.
int cache_state = SetCacheDirty(cache_entry->cache_state);
UpdateCacheWithSubDirectoryType(resource_id,
- md5,
sub_dir_type,
- cache_state);
+ CacheEntry(md5, cache_state));
}
}
@@ -1374,10 +1369,9 @@ void GDataCache::ClearDirty(const std::string& resource_id,
if (*error == base::PLATFORM_FILE_OK) {
// Now that file operations have completed, update cache map.
int cache_state = ClearCacheDirty(cache_entry->cache_state);
- UpdateCacheWithSubDirectoryType(resource_id,
- md5,
+ UpdateCacheWithSubDirectoryType(resource_id,
sub_dir_type,
- cache_state);
+ CacheEntry(md5, cache_state));
}
}
@@ -1514,18 +1508,18 @@ void GDataCache::GetCacheEntryHelper(const std::string& resource_id,
void GDataCache::UpdateCacheWithSubDirectoryType(
const std::string& resource_id,
- const std::string& md5,
CacheSubDirectoryType sub_dir_type,
- int cache_state) {
+ const CacheEntry& in_cache_entry) {
DCHECK(sub_dir_type == CACHE_TYPE_PERSISTENT ||
sub_dir_type == CACHE_TYPE_TMP);
+ CacheEntry cache_entry = in_cache_entry;
if (sub_dir_type == CACHE_TYPE_PERSISTENT)
- cache_state = SetCachePersistent(cache_state);
+ cache_entry.cache_state = SetCachePersistent(cache_entry.cache_state);
else
- cache_state = ClearCachePersistent(cache_state);
+ cache_entry.cache_state = ClearCachePersistent(cache_entry.cache_state);
- metadata_->UpdateCache(resource_id, md5, cache_state);
+ metadata_->UpdateCache(resource_id, cache_entry);
}
// static
« no previous file with comments | « chrome/browser/chromeos/gdata/gdata_cache.h ('k') | chrome/browser/chromeos/gdata/gdata_cache_metadata.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698