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

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

Issue 302063002: Always preload all tokens before parsing (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix another flaky tests Created 6 years, 7 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: Source/core/fetch/ResourceFetcher.cpp
diff --git a/Source/core/fetch/ResourceFetcher.cpp b/Source/core/fetch/ResourceFetcher.cpp
index 16313d0bdac281cfdf92ea711bc31ee79d887a58..ea3ab1fb0d32814a6add28a02b237f4c90700101 100644
--- a/Source/core/fetch/ResourceFetcher.cpp
+++ b/Source/core/fetch/ResourceFetcher.cpp
@@ -894,6 +894,10 @@ ResourceFetcher::RevalidationPolicy ResourceFetcher::determineRevalidationPolicy
// If the same URL has been loaded as a different type, we need to reload.
if (existingResource->type() != type) {
+ // FIXME: If existingResource is a Preload and the new type is LinkPrefetch
+ // We really should discard the new prefetch since the preload has more
+ // specific type information! crbug.com/379893
+ // fast/dom/HTMLLinkElement/link-and-subresource-test hits this case.
WTF_LOG(ResourceLoading, "ResourceFetcher::determineRevalidationPolicy reloading due to type mismatch.");
return Reload;
}
@@ -929,6 +933,10 @@ ResourceFetcher::RevalidationPolicy ResourceFetcher::determineRevalidationPolicy
if (m_allowStaleResources)
return Use;
+ // If fetching a resource with a different 'CORS enabled' flag, reload.
+ if (type != Resource::MainResource && options.corsEnabled != existingResource->options().corsEnabled)
+ return Reload;
+
// Always use preloads.
if (existingResource->isPreloaded())
return Use;
@@ -944,10 +952,6 @@ ResourceFetcher::RevalidationPolicy ResourceFetcher::determineRevalidationPolicy
return Reload;
}
- // If fetching a resource with a different 'CORS enabled' flag, reload.
- if (type != Resource::MainResource && options.corsEnabled != existingResource->options().corsEnabled)
- return Reload;
-
// If credentials were sent with the previous request and won't be
// with this one, or vice versa, re-fetch the resource.
//

Powered by Google App Engine
This is Rietveld 408576698