Changeset 65459 in webkit
- Timestamp:
- Aug 16, 2010 3:22:36 PM (14 years ago)
- Location:
- trunk/WebKit2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit2/ChangeLog
r65457 r65459 1 2010-08-16 Sam Weinig <sam@webkit.org> 2 3 Reviewed by Gavin Barraclough. 4 5 Null CFURLRef returned from provisionalURL after searching on zillow.com 6 <rdar://problem/8261812> 7 https://bugs.webkit.org/show_bug.cgi?id=44072 8 9 Conversion from WKURLRef to CFRURLRef was breaking on URLs using characters 10 such as '{'. 11 12 * UIProcess/API/C/cf/WKURLCF.cpp: 13 (WKURLCopyCFURL): Use code similar to that found in KURLCFNet.cpp for conversion. 14 1 15 2010-08-16 Sam Weinig <sam@webkit.org> 2 16 -
trunk/WebKit2/UIProcess/API/C/cf/WKURLCF.cpp
r64232 r65459 31 31 #include <wtf/RefPtr.h> 32 32 #include <wtf/RetainPtr.h> 33 #include <wtf/text/CString.h> 33 34 34 35 using namespace WebCore; … … 45 46 ASSERT(!toWK(URLRef)->string().isNull()); 46 47 47 // We first create a C FString and then create the CFURL from it. This will ensure that the CFURL is stored in48 // We first create a CString and then create the CFURL from it. This will ensure that the CFURL is stored in 48 49 // UTF-8 which uses less memory and is what WebKit clients might expect. 49 RetainPtr<CFStringRef> urlString(AdoptCF, CFStringCreateWithCharactersNoCopy(kCFAllocatorDefault, reinterpret_cast<const UniChar*>(toWK(URLRef)->string().characters()),50 toWK(URLRef)->string().length(), kCFAllocatorNull));51 50 52 return CFURLCreateWithString(allocatorRef, urlString.get(), 0); 51 // This pattern of using UTF-8 and then falling back to Latin1 on failure matches KURL::createCFString with the 52 // major differnce being that KURL does not do a UTF-8 conversion and instead chops off the high bits of the UTF-16 53 // character sequence. 54 55 CString buffer = toWK(URLRef)->string().utf8(); 56 CFURLRef result = CFURLCreateAbsoluteURLWithBytes(kCFAllocatorDefault, reinterpret_cast<const UInt8*>(buffer.data()), buffer.length(), kCFStringEncodingUTF8, 0, true); 57 if (!result) 58 result = CFURLCreateAbsoluteURLWithBytes(kCFAllocatorDefault, reinterpret_cast<const UInt8*>(buffer.data()), buffer.length(), kCFStringEncodingISOLatin1, 0, true); 59 return result; 53 60 }
Note: See TracChangeset
for help on using the changeset viewer.