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

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 CORS issue with preloader 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 8dc7481614f72fc59d67c9b5b728a3da3b345943..832c4bf4ab2a66a9cdb878028e48233f10bae498 100644
--- a/Source/core/fetch/ResourceFetcher.cpp
+++ b/Source/core/fetch/ResourceFetcher.cpp
@@ -923,6 +923,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;
@@ -938,10 +942,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