[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

weinig at apple.com weinig at apple.com
Wed Dec 22 12:11:13 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit aebb77e9077bee53748d1842cb14e66c60cfb81f
Author: weinig at apple.com <weinig at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Aug 16 22:22:36 2010 +0000

    Null CFURLRef returned from provisionalURL after searching on zillow.com
    <rdar://problem/8261812>
    https://bugs.webkit.org/show_bug.cgi?id=44072
    
    Reviewed by Gavin Barraclough.
    
    Conversion from WKURLRef to CFRURLRef was breaking on URLs using characters
    such as '{'.
    
    * UIProcess/API/C/cf/WKURLCF.cpp:
    (WKURLCopyCFURL): Use code similar to that found in KURLCFNet.cpp for conversion.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65459 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 9f6c80d..d4d089d 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -2,6 +2,20 @@
 
         Reviewed by Gavin Barraclough.
 
+        Null CFURLRef returned from provisionalURL after searching on zillow.com
+        <rdar://problem/8261812>
+        https://bugs.webkit.org/show_bug.cgi?id=44072
+
+        Conversion from WKURLRef to CFRURLRef was breaking on URLs using characters
+        such as '{'.
+
+        * UIProcess/API/C/cf/WKURLCF.cpp:
+        (WKURLCopyCFURL): Use code similar to that found in KURLCFNet.cpp for conversion.
+
+2010-08-16  Sam Weinig  <sam at webkit.org>
+
+        Reviewed by Gavin Barraclough.
+
         Remove unnecessary copy constructor, assignment operator and swap function.
         The defaults (for all except swap) should do just fine.
 
diff --git a/WebKit2/UIProcess/API/C/cf/WKURLCF.cpp b/WebKit2/UIProcess/API/C/cf/WKURLCF.cpp
index 83ba0eb..26efdc5 100644
--- a/WebKit2/UIProcess/API/C/cf/WKURLCF.cpp
+++ b/WebKit2/UIProcess/API/C/cf/WKURLCF.cpp
@@ -30,6 +30,7 @@
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefPtr.h>
 #include <wtf/RetainPtr.h>
+#include <wtf/text/CString.h>
 
 using namespace WebCore;
 using namespace WebKit;
@@ -44,10 +45,16 @@ CFURLRef WKURLCopyCFURL(CFAllocatorRef allocatorRef, WKURLRef URLRef)
 {
     ASSERT(!toWK(URLRef)->string().isNull());
 
-    // We first create a CFString and then create the CFURL from it. This will ensure that the CFURL is stored in 
+    // We first create a CString and then create the CFURL from it. This will ensure that the CFURL is stored in 
     // UTF-8 which uses less memory and is what WebKit clients might expect.
-    RetainPtr<CFStringRef> urlString(AdoptCF, CFStringCreateWithCharactersNoCopy(kCFAllocatorDefault, reinterpret_cast<const UniChar*>(toWK(URLRef)->string().characters()), 
-                                                                                toWK(URLRef)->string().length(), kCFAllocatorNull));
 
-    return CFURLCreateWithString(allocatorRef, urlString.get(), 0);
+    // This pattern of using UTF-8 and then falling back to Latin1 on failure matches KURL::createCFString with the
+    // major differnce being that KURL does not do a UTF-8 conversion and instead chops off the high bits of the UTF-16
+    // character sequence.
+
+    CString buffer = toWK(URLRef)->string().utf8();
+    CFURLRef result = CFURLCreateAbsoluteURLWithBytes(kCFAllocatorDefault, reinterpret_cast<const UInt8*>(buffer.data()), buffer.length(), kCFStringEncodingUTF8, 0, true);
+    if (!result)
+        result = CFURLCreateAbsoluteURLWithBytes(kCFAllocatorDefault, reinterpret_cast<const UInt8*>(buffer.data()), buffer.length(), kCFStringEncodingISOLatin1, 0, true);
+    return result;
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list