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

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

Issue 514893002: Lower priority of async scripts (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Moved async script priority to low Created 6 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: Source/core/fetch/ResourceFetcher.cpp
diff --git a/Source/core/fetch/ResourceFetcher.cpp b/Source/core/fetch/ResourceFetcher.cpp
index 2c18ad2f1539d303d74975e2e1d590c71a9e4eec..7b41cd0e0820c7940072f35cf7836ace06e9d25c 100644
--- a/Source/core/fetch/ResourceFetcher.cpp
+++ b/Source/core/fetch/ResourceFetcher.cpp
@@ -124,11 +124,14 @@ static ResourceLoadPriority loadPriority(Resource::Type type, const FetchRequest
case Resource::Raw:
return request.options().synchronousPolicy == RequestSynchronously ? ResourceLoadPriorityVeryHigh : ResourceLoadPriorityMedium;
case Resource::Script:
+ // Async scripts do not block the parser so they get the lowest priority and can be
+ // loaded in parser order with images.
+ return request.execAsync() ? ResourceLoadPriorityLow : ResourceLoadPriorityMedium;
case Resource::Font:
case Resource::ImportResource:
return ResourceLoadPriorityMedium;
case Resource::Image:
- // We'll default images to VeryLow, and promote whatever is visible. This improves
+ // Default images to VeryLow, and promote whatever is visible. This improves
// speed-index by ~5% on average, ~14% at the 99th percentile.
return ResourceLoadPriorityVeryLow;
case Resource::Media:

Powered by Google App Engine
This is Rietveld 408576698