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

Unified Diff: Source/core/html/parser/CSSPreloadScanner.cpp

Issue 457413002: Defer late and async scripts (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Lower priorities for late/async scripts 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
« no previous file with comments | « Source/core/html/parser/CSSPreloadScanner.h ('k') | Source/core/html/parser/HTMLPreloadScanner.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/parser/CSSPreloadScanner.cpp
diff --git a/Source/core/html/parser/CSSPreloadScanner.cpp b/Source/core/html/parser/CSSPreloadScanner.cpp
index 29d37d1e8d01667d41c35b2b0d5a1b0c8e55fa2d..a059b01c6e6448a3aecc57c4d7ae50c471c7afdb 100644
--- a/Source/core/html/parser/CSSPreloadScanner.cpp
+++ b/Source/core/html/parser/CSSPreloadScanner.cpp
@@ -36,6 +36,7 @@ namespace blink {
CSSPreloadScanner::CSSPreloadScanner()
: m_state(Initial)
+ , m_isBeforeBody(true)
, m_requests(0)
{
}
@@ -49,6 +50,7 @@ void CSSPreloadScanner::reset()
m_state = Initial;
m_rule.clear();
m_ruleValue.clear();
+ m_isBeforeBody = true;
}
template<typename Char>
@@ -216,6 +218,7 @@ void CSSPreloadScanner::emitRule(const SegmentedString& source)
KURL baseElementURL; // FIXME: This should be passed in from the HTMLPreloadScaner via scan()!
TextPosition position = TextPosition(source.currentLine(), source.currentColumn());
OwnPtr<PreloadRequest> request = PreloadRequest::create(FetchInitiatorTypeNames::css, position, url, baseElementURL, Resource::CSSStyleSheet);
+ request->setIsBeforeBody(m_isBeforeBody);
// FIXME: Should this be including the charset in the preload request?
m_requests->append(request.release());
}
« no previous file with comments | « Source/core/html/parser/CSSPreloadScanner.h ('k') | Source/core/html/parser/HTMLPreloadScanner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698