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

Unified Diff: net/disk_cache/in_flight_backend_io.cc

Issue 7461106: Inform disk cache of WebKit memory cache hits. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/in_flight_backend_io.cc
diff --git a/net/disk_cache/in_flight_backend_io.cc b/net/disk_cache/in_flight_backend_io.cc
index 5d4be1890a69a758a077d577f61f7cbc4add2f4e..773dbeef595b39be70b4af0e14b3ed879de7f2de 100644
--- a/net/disk_cache/in_flight_backend_io.cc
+++ b/net/disk_cache/in_flight_backend_io.cc
@@ -182,6 +182,11 @@ void BackendIO::ReadyForSparseIO(EntryImpl* entry) {
entry_ = entry;
}
+void BackendIO::UpdateRankForExternalCacheHit(EntryImpl* entry) {
+ operation_ = OP_UPDATE_RANK;
+ entry_ = entry;
+}
+
BackendIO::~BackendIO() {}
// Runs on the background thread.
@@ -271,6 +276,10 @@ void BackendIO::ExecuteEntryOperation() {
case OP_IS_READY:
result_ = entry_->ReadyForSparseIOImpl(&my_callback_);
break;
+ case OP_UPDATE_RANK:
+ entry_->UpdateRankForExternalCacheHitImpl();
+ result_ = net::OK;
+ break;
default:
NOTREACHED() << "Invalid Operation";
result_ = net::ERR_UNEXPECTED;
@@ -436,6 +445,12 @@ void InFlightBackendIO::ReadyForSparseIO(EntryImpl* entry,
PostOperation(operation);
}
+void InFlightBackendIO::UpdateRankForExternalCacheHit(EntryImpl* entry) {
+ scoped_refptr<BackendIO> operation(new BackendIO(this, backend_, NULL));
+ operation->UpdateRankForExternalCacheHit(entry);
+ PostOperation(operation);
+}
+
void InFlightBackendIO::WaitForPendingIO() {
InFlightIO::WaitForPendingIO();
}

Powered by Google App Engine
This is Rietveld 408576698