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

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

Issue 798963002: Only populate line number in case parsing synchronously. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years 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: Source/core/html/parser/HTMLDocumentParser.cpp
diff --git a/Source/core/html/parser/HTMLDocumentParser.cpp b/Source/core/html/parser/HTMLDocumentParser.cpp
index c7fc2c6758a7e9a5a4ab7963765ce371c79d535c..f0d2e2f0d6f2391fa45218e80291df35990f74b5 100644
--- a/Source/core/html/parser/HTMLDocumentParser.cpp
+++ b/Source/core/html/parser/HTMLDocumentParser.cpp
@@ -119,6 +119,7 @@ HTMLDocumentParser::HTMLDocumentParser(HTMLDocument& document, bool reportErrors
, m_tasksWereSuspended(false)
, m_pumpSessionNestingLevel(0)
, m_pumpSpeculationsSessionNestingLevel(0)
+ , m_hasLineNumber(false)
{
ASSERT(shouldUseThreading() || (m_token && m_tokenizer));
}
@@ -415,6 +416,7 @@ void HTMLDocumentParser::discardSpeculationsAndResumeFrom(PassOwnPtr<ParsedChunk
size_t HTMLDocumentParser::processParsedChunkFromBackgroundParser(PassOwnPtr<ParsedChunk> popChunk)
{
TRACE_EVENT0("blink", "HTMLDocumentParser::processParsedChunkFromBackgroundParser");
+ m_hasLineNumber = true;
rmcilroy 2014/12/12 14:18:31 nit - how about using TemporaryChange here?
pfeldman 2014/12/12 17:21:06 Done.
ASSERT_WITH_SECURITY_IMPLICATION(document()->activeParserCount() == 1);
ASSERT(!isParsingFragment());
@@ -489,6 +491,8 @@ size_t HTMLDocumentParser::processParsedChunkFromBackgroundParser(PassOwnPtr<Par
if (!isStopped())
m_treeBuilder->flush(FlushIfAtTextLimit);
+ m_hasLineNumber = false;
+
return elementTokenCount;
}
@@ -907,6 +911,11 @@ bool HTMLDocumentParser::isExecutingScript() const
return m_scriptRunner->isExecutingScript();
}
+bool HTMLDocumentParser::hasLineNumber() const
+{
+ return m_hasLineNumber;
+}
+
OrdinalNumber HTMLDocumentParser::lineNumber() const
{
if (m_haveBackgroundParser)

Powered by Google App Engine
This is Rietveld 408576698