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

Unified Diff: Source/core/html/parser/HTMLDocumentParser.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 | « Source/core/html/parser/BackgroundHTMLParser.cpp ('k') | Source/core/html/parser/XSSAuditor.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 30aa14e116c786ebb340dd1d751da41a6e161a18..ed850672e2001a72b56d6a73ea725023a5cfbf5f 100644
--- a/Source/core/html/parser/HTMLDocumentParser.cpp
+++ b/Source/core/html/parser/HTMLDocumentParser.cpp
@@ -625,16 +625,17 @@ void HTMLDocumentParser::pumpTokenizer()
// much we parsed as part of didWriteHTML instead of willWriteHTML.
TRACE_EVENT_BEGIN1("devtools.timeline", "ParseHTML", "beginData", InspectorParseHtmlEvent::beginData(document(), m_input.current().currentLine().zeroBasedInt()));
- m_xssAuditor.init(document(), &m_xssAuditorDelegate);
+ if (!isParsingFragment())
+ m_xssAuditor.init(document(), &m_xssAuditorDelegate);
while (canTakeNextToken()) {
- if (!isParsingFragment())
+ if (m_xssAuditor.isEnabled())
m_sourceTracker.start(m_input.current(), m_tokenizer.get(), token());
if (!m_tokenizer->nextToken(m_input.current(), token()))
break;
- if (!isParsingFragment()) {
+ if (m_xssAuditor.isEnabled()) {
m_sourceTracker.end(m_input.current(), m_tokenizer.get(), token());
// We do not XSS filter innerHTML, which means we (intentionally) fail
« no previous file with comments | « Source/core/html/parser/BackgroundHTMLParser.cpp ('k') | Source/core/html/parser/XSSAuditor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698