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 89516ceb284e987db151243f9c2f8164e39da670..174d5278153741f04c935468de9d3d56cb1e957a 100644 |
--- a/chrome/browser/chromeos/gdata/gdata_cache_metadata.cc |
+++ b/chrome/browser/chromeos/gdata/gdata_cache_metadata.cc |
@@ -154,32 +154,32 @@ void GDataCacheMetadataMap::RemoveFromCache(const std::string& resource_id) { |
} |
} |
-scoped_ptr<GDataCache::CacheEntry> GDataCacheMetadataMap::GetCacheEntry( |
- const std::string& resource_id, |
- const std::string& md5) { |
+bool GDataCacheMetadataMap::GetCacheEntry(const std::string& resource_id, |
+ const std::string& md5, |
+ GDataCache::CacheEntry* entry) { |
satorux1
2012/06/20 15:29:23
add DCHECK(entry); ?
hashimoto
2012/07/11 12:01:56
Done.
|
AssertOnSequencedWorkerPool(); |
CacheMap::iterator iter = cache_map_.find(resource_id); |
if (iter == cache_map_.end()) { |
DVLOG(1) << "Can't find " << resource_id << " in cache map"; |
- return scoped_ptr<GDataCache::CacheEntry>(); |
+ return false; |
} |
- scoped_ptr<GDataCache::CacheEntry> cache_entry( |
- new GDataCache::CacheEntry(iter->second)); |
+ GDataCache::CacheEntry cache_entry(iter->second); |
satorux1
2012/06/20 15:29:23
*entry = iter->second ? then, you don't have to co
hashimoto
2012/06/20 15:38:35
I'd like to keep this copying code since I think i
satorux1
2012/06/20 15:41:20
Good point. Then, you might want to make it a cons
hashimoto
2012/06/20 15:45:30
Oh, I thought CacheEntry(iter->second) was doing s
hashimoto
2012/07/11 12:01:56
Done.
|
- if (!CheckIfMd5Matches(md5, *cache_entry)) { |
+ if (!CheckIfMd5Matches(md5, cache_entry)) { |
DVLOG(1) << "Non-matching md5: want=" << md5 |
<< ", found=[res_id=" << resource_id |
- << ", " << cache_entry->ToString() |
+ << ", " << cache_entry.ToString() |
<< "]"; |
- return scoped_ptr<GDataCache::CacheEntry>(); |
+ return false; |
} |
DVLOG(1) << "Found entry for res_id=" << resource_id |
- << ", " << cache_entry->ToString(); |
+ << ", " << cache_entry.ToString(); |
- return cache_entry.Pass(); |
+ *entry = cache_entry; |
+ return true; |
} |
void GDataCacheMetadataMap::RemoveTemporaryFiles() { |