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

Unified Diff: Source/core/html/parser/HTMLPreloadScanner.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/html/parser/HTMLPreloadScanner.cpp
diff --git a/Source/core/html/parser/HTMLPreloadScanner.cpp b/Source/core/html/parser/HTMLPreloadScanner.cpp
index 1b21bc89b4408a9bbe189b2d614297b7651b7a3c..d30de62c83cb6f09c15a78153ab67edf11be7ebc 100644
--- a/Source/core/html/parser/HTMLPreloadScanner.cpp
+++ b/Source/core/html/parser/HTMLPreloadScanner.cpp
@@ -110,6 +110,7 @@ public:
, m_inputIsImage(false)
, m_sourceSize(0)
, m_sourceSizeSet(false)
+ , m_execAsync(false)
, m_isCORSEnabled(false)
, m_allowCredentials(DoNotAllowStoredCredentials)
, m_mediaValues(mediaValues)
@@ -170,6 +171,7 @@ public:
if (isCORSEnabled())
request->setCrossOriginEnabled(allowStoredCredentials());
request->setCharset(charset());
+ request->setExecAsync(m_execAsync);
return request.release();
}
@@ -182,6 +184,10 @@ private:
setUrlToLoad(attributeValue, DisallowURLReplacement);
else if (match(attributeName, crossoriginAttr))
setCrossOriginAllowed(attributeValue);
+ else if (match(attributeName, asyncAttr))
+ setExecAsync(true);
+ else if (match(attributeName, deferAttr))
+ setExecAsync(true);
}
template<typename NameType>
@@ -337,6 +343,16 @@ private:
m_allowCredentials = DoNotAllowStoredCredentials;
}
+ void setExecAsync(const bool execAsync)
eseidel 2014/09/03 15:15:38 const bool?
Pat Meenan 2014/09/03 16:16:17 Doh, sorry - fixed.
+ {
+ m_execAsync = execAsync;
+ }
+
+ bool execAsync() const
+ {
+ return m_execAsync;
+ }
+
const StringImpl* m_tagImpl;
String m_urlToLoad;
ImageCandidate m_srcsetImageCandidate;
@@ -349,6 +365,7 @@ private:
unsigned m_sourceSize;
bool m_sourceSizeSet;
bool m_isCORSEnabled;
+ bool m_execAsync;
StoredCredentials m_allowCredentials;
RefPtr<MediaValues> m_mediaValues;
};

Powered by Google App Engine
This is Rietveld 408576698