Changeset 148964 in webkit


Ignore:
Timestamp:
Apr 23, 2013 7:54:29 AM (11 years ago)
Author:
akling@apple.com
Message:

XSSAuditor performance regression due to threaded parser changes.
<http://webkit.org/b/115037>
<rdar://problem/13716069>

Reviewed by Anders Carlsson.

From Blink r148792 by <abarth@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):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r148961 r148964  
     12013-04-23  Andreas Kling  <akling@apple.com>
     2
     3        XSSAuditor performance regression due to threaded parser changes.
     4        <http://webkit.org/b/115037>
     5        <rdar://problem/13716069>
     6
     7        Reviewed by Anders Carlsson.
     8
     9        From Blink r148792 by <abarth@chromium.org>:
     10
     11        The refactoring we did for the threaded parser introduced a performance
     12        regression in innerHTML because we'd boot up the XSSAuditor for fragment
     13        parsing. This CL returns to our earlier behavior of not booting up the
     14        XSSAuditor when parsing fragments.
     15
     16        * html/parser/HTMLDocumentParser.cpp:
     17        (WebCore::HTMLDocumentParser::HTMLDocumentParser):
     18        * html/parser/XSSAuditor.cpp:
     19        (WebCore::XSSAuditor::initForFragment):
     20        * html/parser/XSSAuditor.h:
     21        (XSSAuditor):
     22
    1232013-04-23  Andreas Kling  <akling@apple.com>
    224
  • trunk/Source/WebCore/html/parser/HTMLDocumentParser.cpp

    r147413 r148964  
    119119    bool reportErrors = false; // For now document fragment parsing never reports errors.
    120120    m_tokenizer->setState(tokenizerStateForContextElement(contextElement, reportErrors, m_options));
     121    m_xssAuditor.initForFragment();
    121122}
    122123
  • trunk/Source/WebCore/html/parser/XSSAuditor.cpp

    r146549 r148964  
    226226    // Although tempting to call init() at this point, the various objects
    227227    // we want to reference might not all have been constructed yet.
     228}
     229
     230void XSSAuditor::initForFragment()
     231{
     232    ASSERT(isMainThread());
     233    ASSERT(m_state == Uninitialized);
     234    m_state = Initialized;
     235    // When parsing a fragment, we don't enable the XSS auditor because it's
     236    // too much overhead.
     237    ASSERT(!m_isEnabled);
    228238}
    229239
  • trunk/Source/WebCore/html/parser/XSSAuditor.h

    r145695 r148964  
    6060
    6161    void init(Document*, XSSAuditorDelegate*);
     62    void initForFragment();
     63
    6264    PassOwnPtr<XSSInfo> filterToken(const FilterTokenRequest&);
    6365    bool isSafeToSendToAnotherThread() const;
Note: See TracChangeset for help on using the changeset viewer.