No subject
Mon Jan 28 08:41:14 PST 2013
8792">r148792</a> by <abarth at chromium.org>:
The refactoring we did for the threaded parser introduced a performance
regression in innerHTML because we'd boot up the XSSAuditor for fragment
parsing. This CL returns to our earlier behavior of not booting up the
XSSAuditor when parsing fragments.
* html/parser/HTMLDocumentParser.cpp:
(WebCore::HTMLDocumentParser::HTMLDocumentParser):
* html/parser/XSSAuditor.cpp:
(WebCore::XSSAuditor::initForFragment):
* html/parser/XSSAuditor.h:
(XSSAuditor):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href=3D"#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeL=
og</a></li>
<li><a href=3D"#trunkSourceWebCorehtmlparserHTMLDocumentParsercpp">trunk/=
Source/WebCore/html/parser/HTMLDocumentParser.cpp</a></li>
<li><a href=3D"#trunkSourceWebCorehtmlparserXSSAuditorcpp">trunk/Source/W=
ebCore/html/parser/XSSAuditor.cpp</a></li>
<li><a href=3D"#trunkSourceWebCorehtmlparserXSSAuditorh">trunk/Source/Web=
Core/html/parser/XSSAuditor.h</a></li>
</ul>
</div>
<div id=3D"patch">
<h3>Diff</h3>
<a id=3D"trunkSourceWebCoreChangeLog"></a>
<div class=3D"modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (1489=
63 =3D> 148964)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Source/WebCore/ChangeLog 2013-04-23 14:45:=
52 UTC (rev 148963)
+++ trunk/Source/WebCore/ChangeLog 2013-04-23 14:54:29 UTC (rev 148964)
</span><span class=3D"lines">@@ -1,5 +1,27 @@
</span><span class=3D"cx"> 2013-04-23 Andreas Kling <akling at apple.co=
m>
</span><span class=3D"cx">=20
</span><ins>+ XSSAuditor performance regression due to threaded pa=
rser changes.
+ <http://webkit.org/b/115037>
+ <rdar://problem/13716069>
+
+ Reviewed by Anders Carlsson.
+
+ From Blink r148792 by <abarth at chromium.org>:
+
+ The refactoring we did for the threaded parser introduced a perf=
ormance
+ regression in innerHTML because we'd boot up the XSSAuditor for =
fragment
+ parsing. This CL returns to our earlier behavior of not booting =
up the
+ XSSAuditor when parsing fragments.
+
+ * html/parser/HTMLDocumentParser.cpp:
+ (WebCore::HTMLDocumentParser::HTMLDocumentParser):
+ * html/parser/XSSAuditor.cpp:
+ (WebCore::XSSAuditor::initForFragment):
+ * html/parser/XSSAuditor.h:
+ (XSSAuditor):
+
+2013-04-23 Andreas Kling <akling at apple.com>
+
</ins><span class=3D"cx"> Speed up ElementData::getAttributeItem(=
), which is hot.
</span><span class=3D"cx"> <http://webkit.org/b/115031>
</span><span class=3D"cx">=20
</span></span></pre></div>
<a id=3D"trunkSourceWebCorehtmlparserHTMLDocumentParsercpp"></a>
<div class=3D"modfile"><h4>Modified: trunk/Source/WebCore/html/parser/HTM=
LDocumentParser.cpp (148963 =3D> 148964)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Source/WebCore/html/parser/HTMLDocumentPar=
ser.cpp 2013-04-23 14:45:52 UTC (rev 148963)
+++ trunk/Source/WebCore/html/parser/HTMLDocumentParser.cpp 2013-04-23 14=
:54:29 UTC (rev 148964)
</span><span class=3D"lines">@@ -118,6 +118,7 @@
</span><span class=3D"cx"> ASSERT(!shouldUseThreading());
</span><span class=3D"cx"> bool reportErrors =3D false; // For now do=
cument fragment parsing never reports errors.
</span><span class=3D"cx"> m_tokenizer->setState(tokenizerStateFor=
ContextElement(contextElement, reportErrors, m_options));
</span><ins>+ m_xssAuditor.initForFragment();
</ins><span class=3D"cx"> }
</span><span class=3D"cx">=20
</span><span class=3D"cx"> HTMLDocumentParser::~HTMLDocumentParser()
</span></span></pre></div>
<a id=3D"trunkSourceWebCorehtmlparserXSSAuditorcpp"></a>
<div class=3D"modfile"><h4>Modified: trunk/Source/WebCore/html/parser/XSS=
Auditor.cpp (148963 =3D> 148964)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Source/WebCore/html/parser/XSSAuditor.cpp =
2013-04-23 14:45:52 UTC (rev 148963)
+++ trunk/Source/WebCore/html/parser/XSSAuditor.cpp 2013-04-23 14:54:29 U=
TC (rev 148964)
</span><span class=3D"lines">@@ -227,6 +227,16 @@
</span><span class=3D"cx"> // we want to reference might not all have=
been constructed yet.
</span><span class=3D"cx"> }
</span><span class=3D"cx">=20
</span><ins>+void XSSAuditor::initForFragment()
+{
+ ASSERT(isMainThread());
+ ASSERT(m_state =3D=3D Uninitialized);
+ m_state =3D Initialized;
+ // When parsing a fragment, we don't enable the XSS auditor because =
it's
+ // too much overhead.
+ ASSERT(!m_isEnabled);
+}
+
</ins><span class=3D"cx"> void XSSAuditor::init(Document* document, XSSAu=
ditorDelegate* auditorDelegate)
</span><span class=3D"cx"> {
</span><span class=3D"cx"> const size_t miniumLengthForSuffixTree =3D=
512; // FIXME: Tune this parameter.
</span></span></pre></div>
<a id=3D"trunkSourceWebCorehtmlparserXSSAuditorh"></a>
<div class=3D"modfile"><h4>Modified: trunk/Source/WebCore/html/parser/XSS=
Auditor.h (148963 =3D> 148964)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Source/WebCore/html/parser/XSSAuditor.h 20=
13-04-23 14:45:52 UTC (rev 148963)
+++ trunk/Source/WebCore/html/parser/XSSAuditor.h 2013-04-23 14:54:29 UTC=
(rev 148964)
</span><span class=3D"lines">@@ -59,6 +59,8 @@
</span><span class=3D"cx"> XSSAuditor();
</span><span class=3D"cx">=20
</span><span class=3D"cx"> void init(Document*, XSSAuditorDelegate*);
</span><ins>+ void initForFragment();
+
</ins><span class=3D"cx"> PassOwnPtr<XSSInfo> filterToken(const=
FilterTokenRequest&);
</span><span class=3D"cx"> bool isSafeToSendToAnotherThread() const;
</span><span class=3D"cx">=20
</span></span></pre>
</div>
</div>
</body>
</html>
More information about the webkit-changes
mailing list