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

Unified Diff: net/disk_cache/backend_impl.cc

Issue 7461106: Inform disk cache of WebKit memory cache hits. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Implement in backend Created 9 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: net/disk_cache/backend_impl.cc
diff --git a/net/disk_cache/backend_impl.cc b/net/disk_cache/backend_impl.cc
index b03ecda7bc2bb0ee54fb0645a153e5f567e7246e..295330e9baaa9f2f6e2f4e7414c8294725616063 100644
--- a/net/disk_cache/backend_impl.cc
+++ b/net/disk_cache/backend_impl.cc
@@ -682,6 +682,15 @@ void BackendImpl::SyncEndEnumeration(void* iter) {
reinterpret_cast<Rankings::Iterator*>(iter));
}
+void BackendImpl::SyncOnExternalCacheHit(const std::string& key) {
+ uint32 hash = Hash(key);
+ bool error;
+ EntryImpl* cache_entry = MatchEntry(key, hash, false, Addr(), &error);
+ if (cache_entry) {
+ UpdateRank(cache_entry, false);
+ }
rvargas (doing something else) 2011/07/28 22:27:01 Leaking the entry. We should also check that this
+}
+
EntryImpl* BackendImpl::OpenEntryImpl(const std::string& key) {
if (disabled_)
return NULL;
@@ -1356,6 +1365,10 @@ void BackendImpl::GetStats(StatsItems* stats) {
stats_.GetItems(stats);
}
+void BackendImpl::OnExternalCacheHit(const std::string& key) {
+ background_queue_.OnExternalCacheHit(key);
+}
+
// ------------------------------------------------------------------------
// We just created a new file so we're going to write the header and set the

Powered by Google App Engine
This is Rietveld 408576698