[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

darin darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:23:17 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit e8007a6283e1dbf63e37f349c169ecbb6627fb0e
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Jul 3 19:34:58 2002 +0000

    	A small KURL speed improvement.
    
            * khtml/misc/loader.cpp:
            (Cache::requestImage):
            (Cache::requestStyleSheet):
            (Cache::requestScript):
    	Don't do the isMalformed check, because it's expensive and has no clear benefit.
    	There's no harm in caching null results for malformed URLs.
    
            * kwq/KWQKURL.mm:
            (KURL::KURL): Make the default constructor faster by not running all the
    	normalize code on the empty string.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1510 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 47e21fb..1824259 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,18 @@
+2002-07-03  Darin Adler  <darin at apple.com>
+
+	A small KURL speed improvement.
+
+        * khtml/misc/loader.cpp:
+        (Cache::requestImage):
+        (Cache::requestStyleSheet):
+        (Cache::requestScript):
+	Don't do the isMalformed check, because it's expensive and has no clear benefit.
+	There's no harm in caching null results for malformed URLs.
+
+        * kwq/KWQKURL.mm:
+        (KURL::KURL): Make the default constructor faster by not running all the
+	normalize code on the empty string.
+
 === Alexander-11 ===
 
 2002-07-03  Maciej Stachowiak  <mjs at apple.com>
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 47e21fb..1824259 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,18 @@
+2002-07-03  Darin Adler  <darin at apple.com>
+
+	A small KURL speed improvement.
+
+        * khtml/misc/loader.cpp:
+        (Cache::requestImage):
+        (Cache::requestStyleSheet):
+        (Cache::requestScript):
+	Don't do the isMalformed check, because it's expensive and has no clear benefit.
+	There's no harm in caching null results for malformed URLs.
+
+        * kwq/KWQKURL.mm:
+        (KURL::KURL): Make the default constructor faster by not running all the
+	normalize code on the empty string.
+
 === Alexander-11 ===
 
 2002-07-03  Maciej Stachowiak  <mjs at apple.com>
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 47e21fb..1824259 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,18 @@
+2002-07-03  Darin Adler  <darin at apple.com>
+
+	A small KURL speed improvement.
+
+        * khtml/misc/loader.cpp:
+        (Cache::requestImage):
+        (Cache::requestStyleSheet):
+        (Cache::requestScript):
+	Don't do the isMalformed check, because it's expensive and has no clear benefit.
+	There's no harm in caching null results for malformed URLs.
+
+        * kwq/KWQKURL.mm:
+        (KURL::KURL): Make the default constructor faster by not running all the
+	normalize code on the empty string.
+
 === Alexander-11 ===
 
 2002-07-03  Maciej Stachowiak  <mjs at apple.com>
diff --git a/WebCore/khtml/misc/loader.cpp b/WebCore/khtml/misc/loader.cpp
index 1c0831c..e12ec42 100644
--- a/WebCore/khtml/misc/loader.cpp
+++ b/WebCore/khtml/misc/loader.cpp
@@ -1341,6 +1341,9 @@ CachedImage *Cache::requestImage( DocLoader* dl, const DOMString & url, bool rel
         cachePolicy = KIO::CC_Verify;
     }
 
+#ifdef APPLE_CHANGES
+    // Checking if the URL is malformed is lots of extra work for little benefit.
+#else
     if( kurl.isMalformed() )
     {
 #ifdef CACHE_DEBUG
@@ -1348,6 +1351,7 @@ CachedImage *Cache::requestImage( DocLoader* dl, const DOMString & url, bool rel
 #endif
       return 0;
     }
+#endif
 
     CachedObject *o = 0;
     if (!reload)
@@ -1416,11 +1420,15 @@ CachedCSSStyleSheet *Cache::requestStyleSheet( DocLoader* dl, const DOMString &
         cachePolicy = KIO::CC_Verify;
     }
 
+#ifdef APPLE_CHANGES
+    // Checking if the URL is malformed is lots of extra work for little benefit.
+#else
     if( kurl.isMalformed() )
     {
       kdDebug( 6060 ) << "Cache: Malformed url: " << kurl.url() << endl;
       return 0;
     }
+#endif
 
     CachedObject *o = cache->find(kurl.url());
     if(!o)
@@ -1496,11 +1504,15 @@ CachedScript *Cache::requestScript( DocLoader* dl, const DOM::DOMString &url, bo
         cachePolicy = KIO::CC_Verify;
     }
 
+#ifdef APPLE_CHANGES
+    // Checking if the URL is malformed is lots of extra work for little benefit.
+#else
     if( kurl.isMalformed() )
     {
       kdDebug( 6060 ) << "Cache: Malformed url: " << kurl.url() << endl;
       return 0;
     }
+#endif
 
     CachedObject *o = cache->find(kurl.url());
     if(!o)
diff --git a/WebCore/kwq/KWQKURL.mm b/WebCore/kwq/KWQKURL.mm
index d92fada..203c94c 100644
--- a/WebCore/kwq/KWQKURL.mm
+++ b/WebCore/kwq/KWQKURL.mm
@@ -352,97 +352,89 @@ void KURL::clearCaches()
 
 QString KURL::normalizeURLString(const QString &s)
 {
-    CFMutableStringRef result = NULL;
-
     if (NormalizedURLCache == NULL) {
 	NormalizedURLCache = CFDictionaryCreateMutable(NULL, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); 
     }
 
-    result = (CFMutableStringRef)CFDictionaryGetValue(NormalizedURLCache, s.getCFMutableString());
-
+    CFMutableStringRef result = (CFMutableStringRef)CFDictionaryGetValue(NormalizedURLCache, s.getCFMutableString());
     if (result != NULL) {
 	return QString::fromCFMutableString(result);
-    } else {
-	// normalize the URL string as KURL would:
+    }
+    
+    // normalize the URL string as KURL would:
 
-	QString qurl = QString(s);
+    QString qurl = s;
 
-	// Special handling for paths
-	if (!qurl.isEmpty() && qurl[0] == '/') {
-	    qurl = QString("file:") + qurl;
-	}
+    // Special handling for paths
+    if (!qurl.isEmpty() && qurl[0] == '/') {
+        qurl = QString("file:") + qurl;
+    }
 
-	if (d.isNull()) {
-	    d = KWQRefPtr<KWQKURLPrivate>(new KWQKURLPrivate(qurl));
-	}
+    // FIXME: Do we really have to parse even the simplest URLs into pieces just to normalize them?
+    if (d.isNull()) {
+        d = KWQRefPtr<KWQKURLPrivate>(new KWQKURLPrivate(qurl));
+    }
 
-	qurl = d->sURL;
+    qurl = d->sURL;
 
-	if (qurl.startsWith("file:///")) {
-	    qurl = QString("file:/") + qurl.mid(8);
-	} else if (qurl == "file://localhost") {
-	    qurl = QString("file:");
-	} else if (qurl.startsWith("file://localhost/")) {
-	    qurl = QString("file:/") + qurl.mid(17);
-	}
+    if (qurl.startsWith("file:///")) {
+        qurl = QString("file:/") + qurl.mid(8);
+    } else if (qurl == "file://localhost") {
+        qurl = QString("file:");
+    } else if (qurl.startsWith("file://localhost/")) {
+        qurl = QString("file:/") + qurl.mid(17);
+    }
 
-	CFDictionarySetValue(NormalizedURLCache, s.getCFMutableString(), qurl.getCFMutableString());
+    CFDictionarySetValue(NormalizedURLCache, s.getCFMutableString(), qurl.getCFMutableString());
 
-	return qurl;
-    }
+    return qurl;
 }
 
 QString KURL::normalizeRelativeURLString(const KURL &base, const QString &relative)
 {
-    CFMutableStringRef result = NULL;
-    RelativeURLKey key = { base.urlString.getCFMutableString(), relative.getCFMutableString(), 0 };
-
     if (NormalizedRelativeURLCache == NULL) {
 	NormalizedRelativeURLCache = CFDictionaryCreateMutable(NULL, 0, &RelativeURLKeyCallBacks, &kCFTypeDictionaryValueCallBacks); 
     }
 
-    result = (CFMutableStringRef)CFDictionaryGetValue(NormalizedRelativeURLCache, &key);
-
-    if (result != NULL) {
-	return QString::fromCFMutableString(result);
+    RelativeURLKey key = { base.urlString.getCFMutableString(), relative.getCFMutableString(), 0 };
+    CFMutableStringRef cachedResult = (CFMutableStringRef)CFDictionaryGetValue(NormalizedRelativeURLCache, &key);
+    if (cachedResult != NULL) {
+	return QString::fromCFMutableString(cachedResult);
+    }
+    
+    QString result;
+    if (relative.isEmpty()) {
+        result = base.urlString;
     } else {
-	QString result;
-	if (relative.isEmpty()) {
-	    result = base.urlString;
-	} else {
-	    base.parse();
+        base.parse();
 
-	    CFStringRef relativeURLString = CFURLCreateStringByAddingPercentEscapes
-                (NULL, relative.getCFMutableString(), CFSTR("%#"), NULL, kCFStringEncodingUTF8);
+        CFStringRef relativeURLString = CFURLCreateStringByAddingPercentEscapes
+            (NULL, relative.getCFMutableString(), CFSTR("%#"), NULL, kCFStringEncodingUTF8);
 
-	    CFURLRef relativeURL = CFURLCreateWithString(NULL, relativeURLString, base.d->urlRef);
+        CFURLRef relativeURL = CFURLCreateWithString(NULL, relativeURLString, base.d->urlRef);
 
-	    CFRelease(relativeURLString);
+        CFRelease(relativeURLString);
 
-	    if (relativeURL == NULL) {
-		result = normalizeURLString(relative);
-	    } else {
-		CFURLRef absoluteURL = CFURLCopyAbsoluteURL(relativeURL);
-                
-		result = normalizeURLString(QString::fromCFString(CFURLGetString(absoluteURL)));
-                
-		CFRelease(relativeURL);
-		CFRelease(absoluteURL);
-	    }
-	}
-		
-	CFDictionarySetValue(NormalizedRelativeURLCache, 
-			     new RelativeURLKey(key), 
-			     result.getCFMutableString());
-	return result;
+        if (relativeURL == NULL) {
+            result = normalizeURLString(relative);
+        } else {
+            CFURLRef absoluteURL = CFURLCopyAbsoluteURL(relativeURL);
+            
+            result = normalizeURLString(QString::fromCFString(CFURLGetString(absoluteURL)));
+            
+            CFRelease(relativeURL);
+            CFRelease(absoluteURL);
+        }
     }
+            
+    CFDictionarySetValue(NormalizedRelativeURLCache, new RelativeURLKey(key), result.getCFMutableString());
+    return result;
 }
 
 // KURL
 
 KURL::KURL() : 
-    d(NULL),
-    urlString(normalizeURLString(QString()))
+    d(NULL)
 {
 }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list