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

Unified Diff: third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.h

Issue 2826213003: Don't lower priority for scripts inserted by doc.write (Closed)
Patch Set: Fixed duplicate URLs in Layout test Created 3 years, 8 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/html/parser/HTMLPreloadScanner.h
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.h b/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.h
index d5936afdf3efaaecf92d5f12d80087907b3f8487..9971f77b66f8a3c9cae62bc217589bd0e2fc37c5 100644
--- a/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.h
+++ b/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.h
@@ -82,9 +82,12 @@ class TokenPreloadScanner {
USING_FAST_MALLOC(TokenPreloadScanner);
public:
+ enum class ScannerType { kMainDocument, kInsertion };
+
TokenPreloadScanner(const KURL& document_url,
std::unique_ptr<CachedDocumentParameters>,
- const MediaValuesCached::MediaValuesCachedData&);
+ const MediaValuesCached::MediaValuesCachedData&,
+ const ScannerType);
~TokenPreloadScanner();
void Scan(const HTMLToken&,
@@ -162,6 +165,7 @@ class TokenPreloadScanner {
std::unique_ptr<CachedDocumentParameters> document_parameters_;
Persistent<MediaValuesCached> media_values_;
ClientHintsPreferences client_hints_preferences_;
+ ScannerType scanner_type_;
bool did_rewind_ = false;
@@ -177,11 +181,11 @@ class CORE_EXPORT HTMLPreloadScanner {
const HTMLParserOptions& options,
const KURL& document_url,
std::unique_ptr<CachedDocumentParameters> document_parameters,
- const MediaValuesCached::MediaValuesCachedData&
- media_values_cached_data) {
+ const MediaValuesCached::MediaValuesCachedData& media_values_cached_data,
+ const TokenPreloadScanner::ScannerType scanner_type) {
return WTF::WrapUnique(new HTMLPreloadScanner(
options, document_url, std::move(document_parameters),
- media_values_cached_data));
+ media_values_cached_data, scanner_type));
}
~HTMLPreloadScanner();
@@ -194,7 +198,8 @@ class CORE_EXPORT HTMLPreloadScanner {
HTMLPreloadScanner(const HTMLParserOptions&,
const KURL& document_url,
std::unique_ptr<CachedDocumentParameters>,
- const MediaValuesCached::MediaValuesCachedData&);
+ const MediaValuesCached::MediaValuesCachedData&,
+ const TokenPreloadScanner::ScannerType);
TokenPreloadScanner scanner_;
SegmentedString source_;

Powered by Google App Engine
This is Rietveld 408576698