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

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: deleted custom mac expectation 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
« no previous file with comments | « Source/core/html/parser/HTMLDocumentParser.h ('k') | Source/core/inspector/ConsoleMessage.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 dfda1ee0af44de7ce5dcc2e95ac0f9bc88f0af4b..075d613a8b6d51d425c114b816eae84798f118f3 100644
--- a/Source/core/html/parser/HTMLDocumentParser.cpp
+++ b/Source/core/html/parser/HTMLDocumentParser.cpp
@@ -45,6 +45,7 @@
#include "platform/TraceEvent.h"
#include "public/platform/WebThreadedDataReceiver.h"
#include "wtf/Functional.h"
+#include "wtf/TemporaryChange.h"
namespace blink {
@@ -119,6 +120,7 @@ HTMLDocumentParser::HTMLDocumentParser(HTMLDocument& document, bool reportErrors
, m_tasksWereSuspended(false)
, m_pumpSessionNestingLevel(0)
, m_pumpSpeculationsSessionNestingLevel(0)
+ , m_isParsingAtLineNumber(false)
{
ASSERT(shouldUseThreading() || (m_token && m_tokenizer));
}
@@ -402,6 +404,7 @@ void HTMLDocumentParser::discardSpeculationsAndResumeFrom(PassOwnPtr<ParsedChunk
size_t HTMLDocumentParser::processParsedChunkFromBackgroundParser(PassOwnPtr<ParsedChunk> popChunk)
{
TRACE_EVENT0("blink", "HTMLDocumentParser::processParsedChunkFromBackgroundParser");
+ TemporaryChange<bool> hasLineNumber(m_isParsingAtLineNumber, true);
ASSERT_WITH_SECURITY_IMPLICATION(document()->activeParserCount() == 1);
ASSERT(!isParsingFragment());
@@ -476,6 +479,8 @@ size_t HTMLDocumentParser::processParsedChunkFromBackgroundParser(PassOwnPtr<Par
if (!isStopped())
m_treeBuilder->flush(FlushIfAtTextLimit);
+ m_isParsingAtLineNumber = false;
+
return elementTokenCount;
}
@@ -888,6 +893,11 @@ bool HTMLDocumentParser::isExecutingScript() const
return m_scriptRunner->isExecutingScript();
}
+bool HTMLDocumentParser::isParsingAtLineNumber() const
+{
+ return m_isParsingAtLineNumber && ScriptableDocumentParser::isParsingAtLineNumber();
+}
+
OrdinalNumber HTMLDocumentParser::lineNumber() const
{
if (m_haveBackgroundParser)
« no previous file with comments | « Source/core/html/parser/HTMLDocumentParser.h ('k') | Source/core/inspector/ConsoleMessage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698