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

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

Issue 1322063002: Run HTMLSourceTracker hooks only when XSSAuditor is enabled (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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 | « no previous file | Source/core/html/parser/HTMLDocumentParser.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/parser/BackgroundHTMLParser.cpp
diff --git a/Source/core/html/parser/BackgroundHTMLParser.cpp b/Source/core/html/parser/BackgroundHTMLParser.cpp
index 6bbde221f630ccffd2b751657d30d90b8b94c09b..024946cd8e1e3378d4bcc45c5d54d308222d62c4 100644
--- a/Source/core/html/parser/BackgroundHTMLParser.cpp
+++ b/Source/core/html/parser/BackgroundHTMLParser.cpp
@@ -223,13 +223,17 @@ void BackgroundHTMLParser::pumpTokenizer()
return;
while (true) {
- m_sourceTracker.start(m_input.current(), m_tokenizer.get(), *m_token);
+ if (m_xssAuditor->isEnabled())
+ m_sourceTracker.start(m_input.current(), m_tokenizer.get(), *m_token);
+
if (!m_tokenizer->nextToken(m_input.current(), *m_token)) {
// We've reached the end of our current input.
sendTokensToMainThread();
break;
}
- m_sourceTracker.end(m_input.current(), m_tokenizer.get(), *m_token);
+
+ if (m_xssAuditor->isEnabled())
+ m_sourceTracker.end(m_input.current(), m_tokenizer.get(), *m_token);
{
TextPosition position = TextPosition(m_input.current().currentLine(), m_input.current().currentColumn());
@@ -239,7 +243,7 @@ void BackgroundHTMLParser::pumpTokenizer()
m_pendingXSSInfos.append(xssInfo.release());
}
- CompactHTMLToken token(m_token.get(), TextPosition(m_input.current().currentLine(), m_input.current().currentColumn()));
+ CompactHTMLToken token(m_token.get(), position);
m_preloadScanner->scan(token, m_input.current(), m_pendingPreloads);
simulatedToken = m_treeBuilderSimulator.simulate(token, m_tokenizer.get());
« no previous file with comments | « no previous file | Source/core/html/parser/HTMLDocumentParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698