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

Unified Diff: Source/core/fetch/Resource.cpp

Issue 171303003: Make pruning the memory cache when a resource becomes dead consistent in case of no-store (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/fetch/Resource.cpp
diff --git a/Source/core/fetch/Resource.cpp b/Source/core/fetch/Resource.cpp
index c728f37605973ed619aa0fff404a63f76243168a..ae04c99d0744254b7338f33bf1b7512a723fc7fb 100644
--- a/Source/core/fetch/Resource.cpp
+++ b/Source/core/fetch/Resource.cpp
@@ -507,13 +507,14 @@ void Resource::removeClient(ResourceClient* client)
}
if (!m_switchingClientsToRevalidatedResource)
allClientsRemoved();
- if (response().cacheControlContainsNoStore()) {
- // RFC2616 14.9.2:
- // "no-store: ... MUST make a best-effort attempt to remove the information from volatile storage as promptly as possible"
- // "... History buffers MAY store such responses as part of their normal operation."
- // We allow non-secure content to be reused in history, but we do not allow secure content to be reused.
- if (url().protocolIs("https"))
- memoryCache()->remove(this);
+
+ // RFC2616 14.9.2:
+ // "no-store: ... MUST make a best-effort attempt to remove the information from volatile storage as promptly as possible"
+ // "... History buffers MAY store such responses as part of their normal operation."
+ // We allow non-secure content to be reused in history, but we do not allow secure content to be reused.
+ if (response().cacheControlContainsNoStore() && url().protocolIs("https")) {
+ memoryCache()->remove(this);
+ memoryCache()->prune();
Nate Chapin 2014/02/18 21:35:54 I think it's safe to call prune(this) after removi
} else {
memoryCache()->prune(this);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698