Changeset 144425 in webkit


Ignore:
Timestamp:
Mar 1, 2013 12:47:21 AM (11 years ago)
Author:
mkwst@chromium.org
Message:

XSSAuditor should use threadSafeMatch when relevant.
https://bugs.webkit.org/show_bug.cgi?id=111099

Reviewed by Adam Barth.

Given the work on breaking parsing out into a background thread, we
should compare QualifiedNames in a thread-safe manner. Rather than
casting the result of QualifiedName::localName to a String, we can
call out to threadSafeMatch to do the comparison.

This patch leaves one use of equalIgnoringNullity in
XSSAuditor::findAttributeWithName. That usage seems safe, since we're
creating a new string against which to compare.

  • html/parser/XSSAuditor.cpp:

(WebCore::hasName):

Replace call to equalIgnoringNullity(Vector<UChar...>, String)
with threadSafeMatch(String, QualifiedName).

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r144423 r144425  
     12013-03-01  Mike West  <mkwst@chromium.org>
     2
     3        XSSAuditor should use threadSafeMatch when relevant.
     4        https://bugs.webkit.org/show_bug.cgi?id=111099
     5
     6        Reviewed by Adam Barth.
     7
     8        Given the work on breaking parsing out into a background thread, we
     9        should compare QualifiedNames in a thread-safe manner. Rather than
     10        casting the result of QualifiedName::localName to a String, we can
     11        call out to threadSafeMatch to do the comparison.
     12
     13        This patch leaves one use of equalIgnoringNullity in
     14        XSSAuditor::findAttributeWithName. That usage seems safe, since we're
     15        creating a new string against which to compare.
     16
     17        * html/parser/XSSAuditor.cpp:
     18        (WebCore::hasName):
     19            Replace call to equalIgnoringNullity(Vector<UChar...>, String)
     20            with threadSafeMatch(String, QualifiedName).
     21
    1222013-02-28  Keishi Hattori  <keishi@webkit.org>
    223
  • trunk/Source/WebCore/html/parser/XSSAuditor.cpp

    r144422 r144425  
    116116static bool hasName(const HTMLToken& token, const QualifiedName& name)
    117117{
    118     return equalIgnoringNullity(token.name(), static_cast<const String&>(name.localName()));
     118    return threadSafeMatch(token.nameString(), name);
    119119}
    120120
Note: See TracChangeset for help on using the changeset viewer.