Index: net/disk_cache/backend_impl.cc |
diff --git a/net/disk_cache/backend_impl.cc b/net/disk_cache/backend_impl.cc |
index 232b3f8b295ee2ad0580b47deb9bbbcf9898bda5..e5fbe0906fb1e5caa0eab7dc4aedfb2a489f53c3 100644 |
--- a/net/disk_cache/backend_impl.cc |
+++ b/net/disk_cache/backend_impl.cc |
@@ -478,6 +478,8 @@ int BackendImpl::SyncInit() { |
if (cache_type() == net::APP_CACHE) { |
DCHECK(!new_eviction_); |
read_only_ = true; |
+ } else if (cache_type() == net::SHADER_CACHE) { |
+ DCHECK(!new_eviction_); |
} |
eviction_.Init(this); |
@@ -670,7 +672,7 @@ void BackendImpl::SyncOnExternalCacheHit(const std::string& key) { |
EntryImpl* cache_entry = MatchEntry(key, hash, false, Addr(), &error); |
if (cache_entry) { |
if (ENTRY_NORMAL == cache_entry->entry()->Data()->state) { |
- UpdateRank(cache_entry, false); |
+ UpdateRankOnCacheHit(cache_entry, false); |
rvargas (doing something else)
2013/02/13 02:27:17
Not so happy.
How about
UpdateRank(cache_entry, c
dsinclair
2013/02/13 18:20:09
Done. That's much nicer. Thanks.
On 2013/02/13 02
|
} |
cache_entry->Release(); |
} |
@@ -921,10 +923,16 @@ LruData* BackendImpl::GetLruData() { |
return &data_->header.lru; |
} |
+void BackendImpl::UpdateRankOnCacheHit(EntryImpl* entry, bool modified) { |
+ if (read_only_) |
+ return; |
+ eviction_.UpdateRank(entry, modified); |
+} |
+ |
void BackendImpl::UpdateRank(EntryImpl* entry, bool modified) { |
- if (!read_only_) { |
- eviction_.UpdateRank(entry, modified); |
- } |
+ if (read_only_ || (!modified && cache_type() == net::SHADER_CACHE)) |
+ return; |
+ eviction_.UpdateRank(entry, modified); |
} |
void BackendImpl::RecoveredEntry(CacheRankingsBlock* rankings) { |