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

Side by Side Diff: third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/platform/loader/fetch/RawResource.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de)
3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org)
4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org)
5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All 5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
6 rights reserved. 6 rights reserved.
7 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ 7 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/
8 8
9 This library is free software; you can redistribute it and/or 9 This library is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Library General Public 10 modify it under the terms of the GNU Library General Public
(...skipping 835 matching lines...) Expand 10 before | Expand all | Expand 10 after
846 // mismatch, the MemoryCache must be skipped here, and a new request for the 846 // mismatch, the MemoryCache must be skipped here, and a new request for the
847 // resource must be made to get the raw data. This is expected to be an 847 // resource must be made to get the raw data. This is expected to be an
848 // uncommon case, however, as it implies two same-origin requests to the same 848 // uncommon case, however, as it implies two same-origin requests to the same
849 // resource, but with different integrity metadata. 849 // resource, but with different integrity metadata.
850 RecordSriResourceIntegrityMismatchEvent(kCheckingForIntegrityMismatch); 850 RecordSriResourceIntegrityMismatchEvent(kCheckingForIntegrityMismatch);
851 if (existing_resource->MustRefetchDueToIntegrityMetadata(fetch_params)) { 851 if (existing_resource->MustRefetchDueToIntegrityMetadata(fetch_params)) {
852 RecordSriResourceIntegrityMismatchEvent(kRefetchDueToIntegrityMismatch); 852 RecordSriResourceIntegrityMismatchEvent(kRefetchDueToIntegrityMismatch);
853 return kReload; 853 return kReload;
854 } 854 }
855 855
856 // Service Worker's CORS fallback message must not be cached.
857 if (existing_resource->GetResponse().WasFallbackRequiredByServiceWorker())
858 return kReload;
859
860 // If the same URL has been loaded as a different type, we need to reload. 856 // If the same URL has been loaded as a different type, we need to reload.
861 if (existing_resource->GetType() != type) { 857 if (existing_resource->GetType() != type) {
862 // FIXME: If existingResource is a Preload and the new type is LinkPrefetch 858 // FIXME: If existingResource is a Preload and the new type is LinkPrefetch
863 // We really should discard the new prefetch since the preload has more 859 // We really should discard the new prefetch since the preload has more
864 // specific type information! crbug.com/379893 860 // specific type information! crbug.com/379893
865 // fast/dom/HTMLLinkElement/link-and-subresource-test hits this case. 861 // fast/dom/HTMLLinkElement/link-and-subresource-test hits this case.
866 RESOURCE_LOADING_DVLOG(1) << "ResourceFetcher::determineRevalidationPolicy " 862 RESOURCE_LOADING_DVLOG(1) << "ResourceFetcher::determineRevalidationPolicy "
867 "reloading due to type mismatch."; 863 "reloading due to type mismatch.";
868 return kReload; 864 return kReload;
869 } 865 }
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after
1580 visitor->Trace(context_); 1576 visitor->Trace(context_);
1581 visitor->Trace(archive_); 1577 visitor->Trace(archive_);
1582 visitor->Trace(loaders_); 1578 visitor->Trace(loaders_);
1583 visitor->Trace(non_blocking_loaders_); 1579 visitor->Trace(non_blocking_loaders_);
1584 visitor->Trace(document_resources_); 1580 visitor->Trace(document_resources_);
1585 visitor->Trace(preloads_); 1581 visitor->Trace(preloads_);
1586 visitor->Trace(resource_timing_info_map_); 1582 visitor->Trace(resource_timing_info_map_);
1587 } 1583 }
1588 1584
1589 } // namespace blink 1585 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/loader/fetch/RawResource.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698