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

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

Issue 1104103002: Add <meta viewport> support to the preloader (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: moved CachedDocumentParameters constructor to private Created 5 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
« no previous file with comments | « Source/core/html/HTMLMetaElement-in.cpp ('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/HTMLDocumentParser.cpp
diff --git a/Source/core/html/parser/HTMLDocumentParser.cpp b/Source/core/html/parser/HTMLDocumentParser.cpp
index dc0f6e98275ddc9b3cb2c5f96327d8f1bbd1949c..83442b91ee1a9f1baa0afb0fb4a3b17a9be0c34e 100644
--- a/Source/core/html/parser/HTMLDocumentParser.cpp
+++ b/Source/core/html/parser/HTMLDocumentParser.cpp
@@ -32,6 +32,7 @@
#include "core/dom/DocumentLifecycleObserver.h"
#include "core/dom/Element.h"
#include "core/frame/LocalFrame.h"
+#include "core/frame/Settings.h"
#include "core/html/HTMLDocument.h"
#include "core/html/parser/AtomicHTMLToken.h"
#include "core/html/parser/BackgroundHTMLParser.h"
@@ -599,14 +600,6 @@ Document* HTMLDocumentParser::contextForParsingSession()
return document();
}
-static PassRefPtr<MediaValues> createMediaValues(Document* document)
-{
- ASSERT(document);
- RefPtr<MediaValues> mediaValues = MediaValuesCached::create(*document);
- ASSERT(mediaValues->isSafeToSendToAnotherThread());
- return mediaValues;
-}
-
void HTMLDocumentParser::pumpTokenizer()
{
ASSERT(!isStopped());
@@ -670,7 +663,9 @@ void HTMLDocumentParser::pumpTokenizer()
// adding paranoia if for speculative crash fix for crbug.com/465478
if (m_preloader) {
if (!m_preloadScanner) {
- m_preloadScanner = adoptPtr(new HTMLPreloadScanner(m_options, document()->url(), createMediaValues(document())));
+ m_preloadScanner = adoptPtr(new HTMLPreloadScanner(m_options,
+ document()->url(),
+ CachedDocumentParameters::create(document())));
m_preloadScanner->appendToEnd(m_input.current());
}
m_preloadScanner->scan(m_preloader.get(), document()->baseElementURL());
@@ -751,8 +746,11 @@ void HTMLDocumentParser::insert(const SegmentedString& source)
if (isWaitingForScripts()) {
// Check the document.write() output with a separate preload scanner as
// the main scanner can't deal with insertions.
- if (!m_insertionPreloadScanner)
- m_insertionPreloadScanner = adoptPtr(new HTMLPreloadScanner(m_options, document()->url(), createMediaValues(document())));
+ if (!m_insertionPreloadScanner) {
+ m_insertionPreloadScanner = adoptPtr(new HTMLPreloadScanner(m_options,
+ document()->url(),
+ CachedDocumentParameters::create(document())));
+ }
m_insertionPreloadScanner->appendToEnd(source);
m_insertionPreloadScanner->scan(m_preloader.get(), document()->baseElementURL());
@@ -766,6 +764,7 @@ void HTMLDocumentParser::startBackgroundParser()
ASSERT(!isStopped());
ASSERT(shouldUseThreading());
ASSERT(!m_haveBackgroundParser);
+ ASSERT(document());
m_haveBackgroundParser = true;
RefPtr<WeakReference<BackgroundHTMLParser>> reference = WeakReference<BackgroundHTMLParser>::createUnbound();
@@ -782,7 +781,7 @@ void HTMLDocumentParser::startBackgroundParser()
config->parser = m_weakFactory.createWeakPtr();
config->xssAuditor = adoptPtr(new XSSAuditor);
config->xssAuditor->init(document(), &m_xssAuditorDelegate);
- config->preloadScanner = adoptPtr(new TokenPreloadScanner(document()->url().copy(), createMediaValues(document())));
+ config->preloadScanner = adoptPtr(new TokenPreloadScanner(document()->url().copy(), CachedDocumentParameters::create(document())));
config->decoder = takeDecoder();
ASSERT(config->xssAuditor->isSafeToSendToAnotherThread());
« no previous file with comments | « Source/core/html/HTMLMetaElement-in.cpp ('k') | Source/core/html/parser/HTMLPreloadScanner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698