Changeset 158456 in webkit
- Timestamp:
- Nov 1, 2013 2:26:50 PM (11 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 2 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r158452 r158456 1 2013-11-01 Dan Bernstein <mitz@apple.com> 2 3 [Cocoa] Avoid some double-wrapping of strings and URLs 4 https://bugs.webkit.org/show_bug.cgi?id=123632 5 6 Reviewed by Anders Carlsson. 7 8 * Shared/API/c/cf/WKStringCF.cpp: Removed. 9 * Shared/API/c/cf/WKStringCF.mm: Copied from Source/WebKit2/Shared/API/c/cf/WKStringCF.cpp. 10 (wkNSStringClass): Added this helper. 11 (WKStringCreateWithCFString): If the passed-in CFString is already wrapping a WebString, 12 then retain it and return it. 13 * Shared/API/c/cf/WKURLCF.cpp: Removed. 14 * Shared/API/c/cf/WKURLCF.mm: Copied from Source/WebKit2/Shared/API/c/cf/WKURLCF.cpp. 15 (wkNSURLClass): Added this helper. 16 (WKURLCreateWithCFURL): If the passed-in CFURL is already wrapping a WebURL, then retain it 17 and return it. 18 * WebKit2.xcodeproj/project.pbxproj: Updated for renames. 19 1 20 2013-11-01 Anders Carlsson <andersca@apple.com> 2 21 -
trunk/Source/WebKit2/Shared/API/c/cf/WKStringCF.mm
r158455 r158456 24 24 */ 25 25 26 #i nclude"config.h"27 #i nclude"WKStringCF.h"26 #import "config.h" 27 #import "WKStringCF.h" 28 28 29 #include "WKAPICast.h" 30 #include <wtf/text/WTFString.h> 29 #import "WKAPICast.h" 30 #import "WKNSString.h" 31 #import <objc/runtime.h> 32 #import <wtf/text/WTFString.h> 31 33 32 34 using namespace WebCore; 33 35 using namespace WebKit; 34 36 37 #if WK_API_ENABLED 38 static inline Class wkNSStringClass() 39 { 40 static dispatch_once_t once; 41 static Class wkNSStringClass; 42 dispatch_once(&once, ^{ 43 wkNSStringClass = [WKNSString class]; 44 }); 45 return wkNSStringClass; 46 } 47 #endif // WK_API_ENABLED 48 35 49 WKStringRef WKStringCreateWithCFString(CFStringRef cfString) 36 50 { 51 #if WK_API_ENABLED 52 // Since WKNSString is an internal class with no subclasses, we can do a simple equality check. 53 if (object_getClass((NSString *)cfString) == wkNSStringClass()) { 54 return toAPI(static_cast<WebString*>(&[(WKNSString *)cfString retain]._apiObject)); 55 } 56 #endif 37 57 String string(cfString); 38 58 return toCopiedAPI(string); -
trunk/Source/WebKit2/Shared/API/c/cf/WKURLCF.mm
r158455 r158456 24 24 */ 25 25 26 #i nclude"config.h"27 #i nclude"WKURLCF.h"26 #import "config.h" 27 #import "WKURLCF.h" 28 28 29 #include "WKAPICast.h" 30 #include <WebCore/CFURLExtras.h> 31 #include <wtf/PassRefPtr.h> 32 #include <wtf/RefPtr.h> 33 #include <wtf/text/CString.h> 34 #include <wtf/text/WTFString.h> 29 #import "WKAPICast.h" 30 #import "WKNSURL.h" 31 #import <WebCore/CFURLExtras.h> 32 #import <objc/runtime.h> 33 #import <wtf/PassRefPtr.h> 34 #import <wtf/RefPtr.h> 35 #import <wtf/text/CString.h> 36 #import <wtf/text/WTFString.h> 35 37 36 38 using namespace WebCore; 37 39 using namespace WebKit; 40 41 #if WK_API_ENABLED 42 static inline Class wkNSURLClass() 43 { 44 static dispatch_once_t once; 45 static Class wkNSURLClass; 46 dispatch_once(&once, ^{ 47 wkNSURLClass = [WKNSURL class]; 48 }); 49 return wkNSURLClass; 50 } 51 #endif // WK_API_ENABLED 38 52 39 53 WKURLRef WKURLCreateWithCFURL(CFURLRef cfURL) … … 41 55 if (!cfURL) 42 56 return 0; 57 58 #if WK_API_ENABLED 59 // Since WKNSURL is an internal class with no subclasses, we can do a simple equality check. 60 if (object_getClass((NSURL *)cfURL) == wkNSURLClass()) { 61 return toAPI(static_cast<WebURL*>(&[(WKNSURL *)cfURL retain]._apiObject)); 62 } 63 #endif 43 64 44 65 CString urlBytes; -
trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
r158413 r158456 851 851 BC40760D124FF0270068F20A /* WKURLResponse.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC4075F1124FF0270068F20A /* WKURLResponse.cpp */; }; 852 852 BC40760E124FF0270068F20A /* WKURLResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = BC4075F2124FF0270068F20A /* WKURLResponse.h */; settings = {ATTRIBUTES = (Private, ); }; }; 853 BC407619124FF0370068F20A /* WKStringCF. cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC407611124FF0370068F20A /* WKStringCF.cpp*/; };853 BC407619124FF0370068F20A /* WKStringCF.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC407611124FF0370068F20A /* WKStringCF.mm */; }; 854 854 BC40761A124FF0370068F20A /* WKStringCF.h in Headers */ = {isa = PBXBuildFile; fileRef = BC407612124FF0370068F20A /* WKStringCF.h */; settings = {ATTRIBUTES = (Private, ); }; }; 855 BC40761B124FF0370068F20A /* WKURLCF. cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC407613124FF0370068F20A /* WKURLCF.cpp*/; };855 BC40761B124FF0370068F20A /* WKURLCF.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC407613124FF0370068F20A /* WKURLCF.mm */; }; 856 856 BC40761C124FF0370068F20A /* WKURLCF.h in Headers */ = {isa = PBXBuildFile; fileRef = BC407614124FF0370068F20A /* WKURLCF.h */; settings = {ATTRIBUTES = (Private, ); }; }; 857 857 BC407627124FF0400068F20A /* WKCertificateInfoMac.h in Headers */ = {isa = PBXBuildFile; fileRef = BC407621124FF0400068F20A /* WKCertificateInfoMac.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 2389 2389 BC4075F1124FF0270068F20A /* WKURLResponse.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKURLResponse.cpp; sourceTree = "<group>"; }; 2390 2390 BC4075F2124FF0270068F20A /* WKURLResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKURLResponse.h; sourceTree = "<group>"; }; 2391 BC407611124FF0370068F20A /* WKStringCF. cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKStringCF.cpp; sourceTree = "<group>"; };2391 BC407611124FF0370068F20A /* WKStringCF.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKStringCF.mm; sourceTree = "<group>"; }; 2392 2392 BC407612124FF0370068F20A /* WKStringCF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKStringCF.h; sourceTree = "<group>"; }; 2393 BC407613124FF0370068F20A /* WKURLCF. cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKURLCF.cpp; sourceTree = "<group>"; };2393 BC407613124FF0370068F20A /* WKURLCF.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKURLCF.mm; sourceTree = "<group>"; }; 2394 2394 BC407614124FF0370068F20A /* WKURLCF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKURLCF.h; sourceTree = "<group>"; }; 2395 2395 BC407621124FF0400068F20A /* WKCertificateInfoMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKCertificateInfoMac.h; sourceTree = "<group>"; }; … … 4760 4760 BCFD5489132D82680055D816 /* WKErrorCF.cpp */, 4761 4761 BCFD548A132D82680055D816 /* WKErrorCF.h */, 4762 BC407611124FF0370068F20A /* WKStringCF. cpp*/,4762 BC407611124FF0370068F20A /* WKStringCF.mm */, 4763 4763 BC407612124FF0370068F20A /* WKStringCF.h */, 4764 BC407613124FF0370068F20A /* WKURLCF. cpp*/,4764 BC407613124FF0370068F20A /* WKURLCF.mm */, 4765 4765 BC407614124FF0370068F20A /* WKURLCF.h */, 4766 4766 ); … … 7253 7253 BC407603124FF0270068F20A /* WKSerializedScriptValue.cpp in Sources */, 7254 7254 BC407605124FF0270068F20A /* WKString.cpp in Sources */, 7255 BC407619124FF0370068F20A /* WKStringCF. cppin Sources */,7255 BC407619124FF0370068F20A /* WKStringCF.mm in Sources */, 7256 7256 1A4A9AA912B7E796008FE984 /* WKTextInputWindowController.mm in Sources */, 7257 7257 BC407607124FF0270068F20A /* WKType.cpp in Sources */, 7258 7258 7CD5EBBE1746B04C000C1C45 /* WKTypeRefWrapper.mm in Sources */, 7259 7259 BC407609124FF0270068F20A /* WKURL.cpp in Sources */, 7260 BC40761B124FF0370068F20A /* WKURLCF. cppin Sources */,7260 BC40761B124FF0370068F20A /* WKURLCF.mm in Sources */, 7261 7261 BC40760B124FF0270068F20A /* WKURLRequest.cpp in Sources */, 7262 7262 BC40762A124FF0400068F20A /* WKURLRequestNS.mm in Sources */,
Note: See TracChangeset
for help on using the changeset viewer.