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

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

Issue 10698157: gdata: Make GDataCache::CacheEntry a struct (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
Index: chrome/browser/chromeos/gdata/gdata_cache_metadata.cc
diff --git a/chrome/browser/chromeos/gdata/gdata_cache_metadata.cc b/chrome/browser/chromeos/gdata/gdata_cache_metadata.cc
index 2ce946c1e8d4f9d8fbd114fcec37cc61c9bb7d17..8b46a62a313b3086dbf7ea3971597288a21a17b5 100644
--- a/chrome/browser/chromeos/gdata/gdata_cache_metadata.cc
+++ b/chrome/browser/chromeos/gdata/gdata_cache_metadata.cc
@@ -182,21 +182,21 @@ void GDataCacheMetadataMap::UpdateCache(
CacheMap::iterator iter = cache_map_.find(resource_id);
if (iter == cache_map_.end()) { // New resource, create new entry.
// Makes no sense to create new entry if cache state is NONE.
- DCHECK(cache_entry.cache_state != GDataCache::CACHE_STATE_NONE);
- if (cache_entry.cache_state != GDataCache::CACHE_STATE_NONE) {
+ DCHECK(cache_entry.cache_state() != GDataCache::CACHE_STATE_NONE);
+ if (cache_entry.cache_state() != GDataCache::CACHE_STATE_NONE) {
cache_map_.insert(std::make_pair(resource_id, cache_entry));
DVLOG(1) << "Added res_id=" << resource_id
<< ", " << cache_entry.ToString();
}
} else { // Resource exists.
// If cache state is NONE, delete entry from cache map.
- if (cache_entry.cache_state == GDataCache::CACHE_STATE_NONE) {
+ if (cache_entry.cache_state() == GDataCache::CACHE_STATE_NONE) {
DVLOG(1) << "Deleting res_id=" << resource_id
<< ", " << iter->second.ToString();
cache_map_.erase(iter);
} else { // Otherwise, update entry in cache map.
- iter->second.md5 = cache_entry.md5;
- iter->second.cache_state = cache_entry.cache_state;
+ iter->second.set_md5(cache_entry.md5());
+ iter->second.set_cache_state(cache_entry.cache_state());
DVLOG(1) << "Updated res_id=" << resource_id
<< ", " << iter->second.ToString();
}
@@ -386,7 +386,7 @@ bool GDataCacheMetadataMap::CheckIfMd5Matches(
// If the entry is dirty, its MD5 may have been replaced by "local"
// during cache initialization, so we don't compare MD5.
return true;
- } else if (cache_entry.IsPinned() && cache_entry.md5.empty()) {
+ } else if (cache_entry.IsPinned() && cache_entry.md5().empty()) {
// If the entry is pinned, it's ok for the entry to have an empty
// MD5. This can happen if the pinned file is not fetched. MD5 for pinned
// files are collected from files in "persistent" directory, but the
@@ -395,7 +395,7 @@ bool GDataCacheMetadataMap::CheckIfMd5Matches(
} else if (md5.empty()) {
// If the MD5 matching is not requested, don't check MD5.
return true;
- } else if (md5 == cache_entry.md5) {
+ } else if (md5 == cache_entry.md5()) {
// Otherwise, compare the MD5.
return true;
}
« no previous file with comments | « chrome/browser/chromeos/gdata/gdata_cache.cc ('k') | chrome/browser/chromeos/gdata/gdata_cache_metadata_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698