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

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: 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/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..2516f33d310f203d3d02a4397a426c49f2fee9e8 100644
--- a/net/disk_cache/in_flight_backend_io.cc
+++ b/net/disk_cache/in_flight_backend_io.cc
@@ -105,6 +105,11 @@ void BackendIO::EndEnumeration(void* iterator) {
iter_ = iterator;
}
+void BackendIO::OnExternalCacheHit(const std::string& key) {
+ operation_ = OP_ON_EXTERNAL_CACHE_HIT;
+ key_ = key;
+}
+
void BackendIO::CloseEntryImpl(EntryImpl* entry) {
operation_ = OP_CLOSE_ENTRY;
entry_ = entry;
@@ -218,6 +223,10 @@ void BackendIO::ExecuteBackendOperation() {
backend_->SyncEndEnumeration(iter_);
result_ = net::OK;
break;
+ case OP_ON_EXTERNAL_CACHE_HIT:
+ backend_->SyncOnExternalCacheHit(key_);
+ result_ = net::OK;
+ break;
case OP_CLOSE_ENTRY:
entry_->Release();
result_ = net::OK;
@@ -358,6 +367,12 @@ void InFlightBackendIO::EndEnumeration(void* iterator) {
PostOperation(operation);
}
+void InFlightBackendIO::OnExternalCacheHit(const std::string& key) {
+ scoped_refptr<BackendIO> operation(new BackendIO(this, backend_, NULL));
+ operation->OnExternalCacheHit(key);
+ PostOperation(operation);
+}
+
void InFlightBackendIO::CloseEntryImpl(EntryImpl* entry) {
scoped_refptr<BackendIO> operation(new BackendIO(this, backend_, NULL));
operation->CloseEntryImpl(entry);

Powered by Google App Engine
This is Rietveld 408576698