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

Unified Diff: third_party/WebKit/Source/platform/loader/fetch/RawResource.cpp

Issue 2830753003: Evict "fallback" RawResource from MemoryCache (Closed)
Patch Set: Created 3 years, 8 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 | third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/loader/fetch/RawResource.cpp
diff --git a/third_party/WebKit/Source/platform/loader/fetch/RawResource.cpp b/third_party/WebKit/Source/platform/loader/fetch/RawResource.cpp
index 4c008f6b78af945050ad33306b6b24c8d54bb862..87fa5b04962c33fb9f04d1b2cb2d67d712e8db7d 100644
--- a/third_party/WebKit/Source/platform/loader/fetch/RawResource.cpp
+++ b/third_party/WebKit/Source/platform/loader/fetch/RawResource.cpp
@@ -183,6 +183,14 @@ void RawResource::WillNotFollowRedirect() {
void RawResource::ResponseReceived(
const ResourceResponse& response,
std::unique_ptr<WebDataConsumerHandle> handle) {
+ if (response.WasFallbackRequiredByServiceWorker()) {
+ // The ServiceWorker asked us to re-fetch the request. This resource must
+ // not be reused.
+ // Note: This logic is needed here because DocumentThreadableLoader handles
+ // CORS independently from ResourceLoader. Fix it.
+ GetMemoryCache()->Remove(this);
+ }
+
bool is_successful_revalidation =
IsCacheValidator() && response.HttpStatusCode() == 304;
Resource::ResponseReceived(response, nullptr);
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698