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

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

Issue 2260303002: Sending an async GET request for doc.written blocked scripts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 4 years, 4 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: third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
diff --git a/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp b/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
index 9b449c347b97a45570c5fdd5c5f113afc134a2b6..260ed426f3ddf3246b71c747f3e3560056947609 100644
--- a/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
+++ b/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
@@ -147,11 +147,13 @@ ResourceLoadPriority ResourceFetcher::computeLoadPriority(Resource::Type type, c
if (type == Resource::Image)
m_imageFetched = true;
- // Special handling for scripts.
- // Default/Parser-Blocking/Preload early in document: High (set in typeToPriority)
- // Async/Defer: Low Priority (applies to both preload and parser-inserted)
- // Preload late in document: Medium
- if (type == Resource::Script) {
+ if (FetchRequest::IdleLoad == request.defer()) {
+ priority = ResourceLoadPriorityVeryLow;
+ } else if (type == Resource::Script) {
+ // Special handling for scripts.
+ // Default/Parser-Blocking/Preload early in document: High (set in typeToPriority)
+ // Async/Defer: Low Priority (applies to both preload and parser-inserted)
+ // Preload late in document: Medium
if (FetchRequest::LazyLoad == request.defer())
priority = ResourceLoadPriorityLow;
else if (request.forPreload() && m_imageFetched)

Powered by Google App Engine
This is Rietveld 408576698