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

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: Fix a crash 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..887521107b7638ee7c04b047ee6d72ed27a1c1a5 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"
@@ -670,7 +671,11 @@ 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(),
+ createMediaValues(document()),
+ document()->viewportDefaultMinWidth(),
+ document()->settings() && document()->settings()->viewportMetaZeroValuesQuirk()));
kouhei (in TOK) 2015/04/30 12:45:39 Can these 3 parameters be made a struct? with a he
m_preloadScanner->appendToEnd(m_input.current());
}
m_preloadScanner->scan(m_preloader.get(), document()->baseElementURL());
@@ -751,8 +756,13 @@ 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(),
+ createMediaValues(document()),
+ document()->viewportDefaultMinWidth(),
+ document()->settings() && document()->settings()->viewportMetaZeroValuesQuirk()));
+ }
m_insertionPreloadScanner->appendToEnd(source);
m_insertionPreloadScanner->scan(m_preloader.get(), document()->baseElementURL());
@@ -766,6 +776,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 +793,10 @@ 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(),
+ createMediaValues(document()),
+ document()->viewportDefaultMinWidth(),
+ document()->settings() && document()->settings()->viewportMetaZeroValuesQuirk()));
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