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

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: Move http check 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..deacdd3c7eb4e23857e947ee845ccc3452458ec3 100644
--- a/net/disk_cache/backend_impl.cc
+++ b/net/disk_cache/backend_impl.cc
@@ -682,6 +682,18 @@ 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) {
+ if (ENTRY_NORMAL == cache_entry->entry()->Data()->state) {
+ UpdateRank(cache_entry, false);
+ }
+ cache_entry->Release();
+ }
+}
+
EntryImpl* BackendImpl::OpenEntryImpl(const std::string& key) {
if (disabled_)
return NULL;
@@ -1356,6 +1368,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