diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2016-04-10 09:28:39 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2016-04-10 09:28:39 +0000 |
commit | 32761a6cee1d0dee366b885b7b9c777e67885688 (patch) | |
tree | d6bec92bebfb216f4126356e55518842c2f476a1 /Source/WebCore/html/parser/HTMLParserScheduler.cpp | |
parent | a4e969f4965059196ca948db781e52f7cfebf19e (diff) | |
download | WebKitGtk-tarball-32761a6cee1d0dee366b885b7b9c777e67885688.tar.gz |
webkitgtk-2.4.11webkitgtk-2.4.11
Diffstat (limited to 'Source/WebCore/html/parser/HTMLParserScheduler.cpp')
-rw-r--r-- | Source/WebCore/html/parser/HTMLParserScheduler.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/Source/WebCore/html/parser/HTMLParserScheduler.cpp b/Source/WebCore/html/parser/HTMLParserScheduler.cpp index 0e42fdef0..974fcbec9 100644 --- a/Source/WebCore/html/parser/HTMLParserScheduler.cpp +++ b/Source/WebCore/html/parser/HTMLParserScheduler.cpp @@ -52,6 +52,16 @@ static double parserTimeLimit(Page* page) return defaultParserTimeLimit; } +static int parserChunkSize(Page* page) +{ + // FIXME: We may need to divide the value from customHTMLTokenizerChunkSize + // by some constant to translate from the "character" based behavior of the + // old LegacyHTMLDocumentParser to the token-based behavior of this parser. + if (page && page->hasCustomHTMLTokenizerChunkSize()) + return page->customHTMLTokenizerChunkSize(); + return defaultParserChunkSize; +} + ActiveParserSession::ActiveParserSession(Document* document) : m_document(document) { @@ -87,8 +97,8 @@ PumpSession::~PumpSession() HTMLParserScheduler::HTMLParserScheduler(HTMLDocumentParser& parser) : m_parser(parser) , m_parserTimeLimit(parserTimeLimit(m_parser.document()->page())) - , m_parserChunkSize(defaultParserChunkSize) - , m_continueNextChunkTimer(*this, &HTMLParserScheduler::continueNextChunkTimerFired) + , m_parserChunkSize(parserChunkSize(m_parser.document()->page())) + , m_continueNextChunkTimer(this, &HTMLParserScheduler::continueNextChunkTimerFired) , m_isSuspendedWithActiveTimer(false) #if !ASSERT_DISABLED , m_suspended(false) @@ -101,9 +111,10 @@ HTMLParserScheduler::~HTMLParserScheduler() m_continueNextChunkTimer.stop(); } -void HTMLParserScheduler::continueNextChunkTimerFired() +void HTMLParserScheduler::continueNextChunkTimerFired(Timer<HTMLParserScheduler>& timer) { ASSERT(!m_suspended); + ASSERT_UNUSED(timer, &timer == &m_continueNextChunkTimer); // FIXME: The timer class should handle timer priorities instead of this code. // If a layout is scheduled, wait again to let the layout timer run first. |