[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

abarth at webkit.org abarth at webkit.org
Thu Apr 8 02:00:59 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 230cbbd24f58de0f7952bb995f536d0a1105a0e2
Author: abarth at webkit.org <abarth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Feb 26 18:09:15 2010 +0000

    2010-02-26  Adam Barth  <abarth at webkit.org>
    
            Reviewed by Darin Adler.
    
            XSSAuditor is super super super slow
            https://bugs.webkit.org/show_bug.cgi?id=35373
    
            In this patch, we separate the decoding cache for the page's URL and
            form data.  Previously, we used the same cache for both, which caused
            us miss the cache every time when the page had form data (because the
            cache only stored one entry).  When the form data is large, we were
            wasting a lot of time canonicalizing.
    
            * page/XSSAuditor.cpp:
            (WebCore::XSSAuditor::findInRequest):
            * page/XSSAuditor.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55290 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 41b627c..756d316 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,20 @@
+2010-02-26  Adam Barth  <abarth at webkit.org>
+
+        Reviewed by Darin Adler.
+
+        XSSAuditor is super super super slow
+        https://bugs.webkit.org/show_bug.cgi?id=35373
+
+        In this patch, we separate the decoding cache for the page's URL and
+        form data.  Previously, we used the same cache for both, which caused
+        us miss the cache every time when the page had form data (because the
+        cache only stored one entry).  When the form data is large, we were
+        wasting a lot of time canonicalizing.
+
+        * page/XSSAuditor.cpp:
+        (WebCore::XSSAuditor::findInRequest):
+        * page/XSSAuditor.h:
+
 2010-02-26  Dirk Schulze  <krit at webkit.org>
 
         Reviewed by Nikolas Zimmermann.
diff --git a/WebCore/page/XSSAuditor.cpp b/WebCore/page/XSSAuditor.cpp
index b71fa49..0df7364 100644
--- a/WebCore/page/XSSAuditor.cpp
+++ b/WebCore/page/XSSAuditor.cpp
@@ -368,7 +368,7 @@ bool XSSAuditor::findInRequest(Frame* frame, const FindTask& task) const
     if (!task.context.isEmpty())
         canonicalizedString = task.context + canonicalizedString;
 
-    String decodedPageURL = m_cache.canonicalizeURL(pageURL, frame->document()->decoder()->encoding(), task.decodeEntities, task.decodeURLEscapeSequencesTwice);
+    String decodedPageURL = m_pageURLCache.canonicalizeURL(pageURL, frame->document()->decoder()->encoding(), task.decodeEntities, task.decodeURLEscapeSequencesTwice);
 
     if (task.allowRequestIfNoIllegalURICharacters && !hasFormData && decodedPageURL.find(&isIllegalURICharacter, 0) == -1)
         return false; // Injection is impossible because the request does not contain any illegal URI characters.
@@ -377,7 +377,7 @@ bool XSSAuditor::findInRequest(Frame* frame, const FindTask& task) const
         return true; // We've found the string in the GET data.
 
     if (hasFormData) {
-        String decodedFormData = m_cache.canonicalizeURL(formDataObj->flattenToString(), frame->document()->decoder()->encoding(), task.decodeEntities, task.decodeURLEscapeSequencesTwice);
+        String decodedFormData = m_formDataCache.canonicalizeURL(formDataObj->flattenToString(), frame->document()->decoder()->encoding(), task.decodeEntities, task.decodeURLEscapeSequencesTwice);
         if (decodedFormData.find(canonicalizedString, 0, false) != -1)
             return true; // We found the string in the POST data.
     }
diff --git a/WebCore/page/XSSAuditor.h b/WebCore/page/XSSAuditor.h
index 3ad50a1..bff6cbe 100644
--- a/WebCore/page/XSSAuditor.h
+++ b/WebCore/page/XSSAuditor.h
@@ -150,7 +150,13 @@ namespace WebCore {
         Frame* m_frame;
 
         // A state store to help us avoid canonicalizing the same URL repeated.
-        mutable CachingURLCanonicalizer m_cache;
+        // When a page has form data, we need two caches: one to store the
+        // canonicalized URL and another to store the cannonicalized form
+        // data. If we only had one cache, we'd always generate a cache miss
+        // and load some pages extremely slowly.
+        // https://bugs.webkit.org/show_bug.cgi?id=35373
+        mutable CachingURLCanonicalizer m_pageURLCache;
+        mutable CachingURLCanonicalizer m_formDataCache;
     };
 
 } // namespace WebCore

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list