Changeset 165118 in webkit
- Timestamp:
- Mar 5, 2014 12:16:10 PM (10 years ago)
- Location:
- trunk/Source
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r165117 r165118 1 2014-03-05 Simon Fraser <simon.fraser@apple.com> 2 3 ObjC exception when dropping files into a WKView: drag and drop uses code from WebKit.framework 4 https://bugs.webkit.org/show_bug.cgi?id=129752 5 6 Reviewed by Enrica Casucci. 7 8 Add C functions for NSURL-related functionality required by WebKit2 9 10 * WebCore.exp.in: 11 * platform/mac/WebCoreNSURLExtras.h: 12 * platform/mac/WebCoreNSURLExtras.mm: 13 (WebCore::URLByCanonicalizingURL): 14 (WebCore::rangeOfURLScheme): 15 (WebCore::looksLikeAbsoluteURL): 16 1 17 2014-03-05 Martin Hock <mhock@apple.com> 2 18 -
trunk/Source/WebCore/WebCore.exp.in
r165117 r165118 76 76 __ZN7WebCore10FontGlyphs15releaseFontDataEv 77 77 __ZN7WebCore10JSDocument6s_infoE 78 __ZN7WebCore10LayoutRectC1ERKNS_9FloatRectE 78 79 __ZN7WebCore10MouseEvent6createERKN3WTF12AtomicStringENS1_10PassRefPtrINS_9DOMWindowEEERKNS_18PlatformMouseEventEiNS5_INS_4NodeEEE 79 80 __ZN7WebCore10MouseEvent6createERKN3WTF12AtomicStringEbbdNS1_10PassRefPtrINS_9DOMWindowEEEiiiiibbbbtNS5_INS_11EventTargetEEENS5_INS_9ClipboardEEEb … … 834 835 __ZN7WebCore20UserGestureIndicatorD1Ev 835 836 __ZN7WebCore20deleteEmptyDirectoryERKN3WTF6StringE 837 __ZN7WebCore20looksLikeAbsoluteURLEP8NSString 836 838 __ZN7WebCore20makeRGBA32FromFloatsEffff 837 839 __ZN7WebCore20previousLinePositionERKNS_15VisiblePositionEiNS_12EditableTypeE … … 895 897 __ZN7WebCore22ScriptExecutionContext2vmEv 896 898 __ZN7WebCore22StorageEventDispatcher34dispatchLocalStorageEventsToFramesERNS_9PageGroupERKN3WTF6VectorINS3_6RefPtrINS_5FrameEEELm0ENS3_15CrashOnOverflowEEERKNS3_6StringESE_SE_SE_PNS_14SecurityOriginE 899 __ZN7WebCore22URLByCanonicalizingURLEP5NSURL 897 900 __ZN7WebCore22URLWithUserTypedStringEP8NSStringP5NSURL 898 901 __ZN7WebCore22WheelEventDeltaTracker17endTrackingDeltasEv … … 1933 1936 __ZTVN7WebCore31BasicColorMatrixFilterOperationE 1934 1937 __ZTVN7WebCore37BasicComponentTransferFilterOperationE 1935 __ZN7WebCore10LayoutRectC1ERKNS_9FloatRectE1936 1938 __ZThn???_N7WebCore15GraphicsLayerCA28platformCALayerPaintContentsEPNS_15PlatformCALayerERNS_15GraphicsContextERKNS_9FloatRectE 1937 1939 __ZThn???_N7WebCore15GraphicsLayerCA31platformCALayerAnimationStartedEd … … 2315 2317 #endif 2316 2318 2319 #if PLATFORM(MAC) || PLATFORM(IOS_SIMULATOR) 2320 _wkSetCrashReportApplicationSpecificInformation 2321 #endif 2322 2317 2323 #if PLATFORM(IOS) 2318 2324 .objc_class_name_NSCursor … … 2447 2453 __ZN7WebCore15GraphicsContext15drawLineForTextERKNS_10FloatPointEfbb 2448 2454 __ZN7WebCore15GraphicsContext15drawNativeImageEP7CGImageRKNS_9FloatSizeENS_10ColorSpaceERKNS_9FloatRectES9_fNS_17CompositeOperatorENS_9BlendModeENS_16ImageOrientationE 2449 __ZN7WebCore15GraphicsContext15drawLineForTextERKNS_10FloatPointEfbb2450 2455 __ZN7WebCore15GraphicsContext22setEmojiDrawingEnabledEb 2451 2456 __ZN7WebCore15GraphicsContext23setIsAcceleratedContextEb … … 2686 2691 #endif 2687 2692 2688 #if PLATFORM(MAC) || PLATFORM(IOS_SIMULATOR)2689 _wkSetCrashReportApplicationSpecificInformation2690 #endif2691 2692 2693 #if ENABLE(3D_RENDERING) 2693 2694 _WebCoreHas3DRendering -
trunk/Source/WebCore/platform/mac/WebCoreNSURLExtras.h
r132925 r165118 40 40 41 41 NSString *userVisibleString(NSURL *); 42 NSURL *URLByCanonicalizingURL(NSURL *); 42 43 NSURL *URLWithUserTypedString(NSString *, NSURL *); 43 44 NSURL *URLByRemovingUserInfo(NSURL *); … … 52 53 NSData *originalURLData(NSURL *); 53 54 NSData *dataForURLComponentType(NSURL *, CFIndex); 55 56 NSRange rangeOfURLScheme(NSString *); 54 57 BOOL isUserVisibleURL(NSString *); 55 58 BOOL looksLikeAbsoluteURL(NSString *); 59 56 60 } // namespace WebCore -
trunk/Source/WebCore/platform/mac/WebCoreNSURLExtras.mm
r154963 r165118 48 48 static pthread_once_t IDNScriptWhiteListFileRead = PTHREAD_ONCE_INIT; 49 49 static uint32_t IDNScriptWhiteList[(USCRIPT_CODE_LIMIT + 31) / 32]; 50 51 52 @interface NSURLProtocol (WKNSURLProtocolInternal) 53 + (Class)_protocolClassForRequest:(NSURLRequest *)request; 54 @end 50 55 51 56 namespace WebCore { … … 713 718 } 714 719 720 NSURL *URLByCanonicalizingURL(NSURL *URL) 721 { 722 RetainPtr<NSURLRequest> request = adoptNS([[NSURLRequest alloc] initWithURL:URL]); 723 Class concreteClass = [NSURLProtocol _protocolClassForRequest:request.get()]; 724 if (!concreteClass) { 725 return URL; 726 } 727 728 // This applies NSURL's concept of canonicalization, but not URL's concept. It would 729 // make sense to apply both, but when we tried that it caused a performance degradation 730 // (see 5315926). It might make sense to apply only the URL concept and not the NSURL 731 // concept, but it's too risky to make that change for WebKit 3.0. 732 NSURLRequest *newRequest = [concreteClass canonicalRequestForRequest:request.get()]; 733 NSURL *newURL = [newRequest URL]; 734 return [[newURL retain] autorelease]; 735 } 736 715 737 NSData *originalURLData(NSURL *URL) 716 738 { … … 881 903 } 882 904 905 NSRange rangeOfURLScheme(NSString *string) 906 { 907 NSRange colon = [string rangeOfString:@":"]; 908 if (colon.location != NSNotFound && colon.location > 0) { 909 NSRange scheme = {0, colon.location}; 910 static NSCharacterSet *InverseSchemeCharacterSet = nil; 911 if (!InverseSchemeCharacterSet) { 912 /* 913 This stuff is very expensive. 10-15 msec on a 2x1.2GHz. If not cached it swamps 914 everything else when adding items to the autocomplete DB. Makes me wonder if we 915 even need to enforce the character set here. 916 */ 917 NSString *acceptableCharacters = @"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+.-"; 918 InverseSchemeCharacterSet = [[[NSCharacterSet characterSetWithCharactersInString:acceptableCharacters] invertedSet] retain]; 919 } 920 NSRange illegals = [string rangeOfCharacterFromSet:InverseSchemeCharacterSet options:0 range:scheme]; 921 if (illegals.location == NSNotFound) 922 return scheme; 923 } 924 return NSMakeRange(NSNotFound, 0); 925 } 926 927 BOOL looksLikeAbsoluteURL(NSString *string) 928 { 929 // Trim whitespace because _web_URLWithString allows whitespace. 930 return rangeOfURLScheme(stringByTrimmingWhitespace(string)).location != NSNotFound; 931 } 932 883 933 } // namespace WebCore -
trunk/Source/WebKit/mac/ChangeLog
r165094 r165118 1 2014-03-05 Simon Fraser <simon.fraser@apple.com> 2 3 ObjC exception when dropping files into a WKView: drag and drop uses code from WebKit.framework 4 https://bugs.webkit.org/show_bug.cgi?id=129752 5 6 Reviewed by Enrica Casucci. 7 8 Call URLByCanonicalizingURL() which is implemented in WebCore. 9 10 * Misc/WebNSURLExtras.mm: 11 (-[NSURL _webkit_canonicalize]): 12 1 13 2014-03-04 Zalan Bujtas <zalan@apple.com> 2 14 -
trunk/Source/WebKit/mac/Misc/WebNSURLExtras.mm
r161185 r165118 129 129 130 130 - (NSURL *)_webkit_canonicalize 131 { 132 NSURLRequest *request = [[NSURLRequest alloc] initWithURL:self]; 133 Class concreteClass = WKNSURLProtocolClassForRequest(request); 134 if (!concreteClass) { 135 [request release]; 136 return self; 137 } 138 139 // This applies NSURL's concept of canonicalization, but not URL's concept. It would 140 // make sense to apply both, but when we tried that it caused a performance degradation 141 // (see 5315926). It might make sense to apply only the URL concept and not the NSURL 142 // concept, but it's too risky to make that change for WebKit 3.0. 143 NSURLRequest *newRequest = [concreteClass canonicalRequestForRequest:request]; 144 NSURL *newURL = [newRequest URL]; 145 NSURL *result = [[newURL retain] autorelease]; 146 [request release]; 147 148 return result; 131 { 132 return URLByCanonicalizingURL(self); 149 133 } 150 134 -
trunk/Source/WebKit2/ChangeLog
r165117 r165118 1 2014-03-05 Simon Fraser <simon.fraser@apple.com> 2 3 ObjC exception when dropping files into a WKView: drag and drop uses code from WebKit.framework 4 https://bugs.webkit.org/show_bug.cgi?id=129752 5 6 Reviewed by Enrica Casucci. 7 8 Get WebDragClientMac off of all WebKit headers, and WebEditorClientMac off 9 all but one by using C functions from WebCoreNSURLExtras.h rather than 10 the NSURL category. 11 12 * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: 13 (WebKit::WebDragClient::declareAndWriteDragImage): 14 * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm: 15 (WebKit::WebEditorClient::userVisibleString): 16 (WebKit::WebEditorClient::canonicalizeURL): 17 (WebKit::WebEditorClient::canonicalizeURLString): 18 1 19 2014-03-05 Martin Hock <mhock@apple.com> 2 20 -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm
r162505 r165118 42 42 #import <WebCore/GraphicsContext.h> 43 43 #import <WebCore/LegacyWebArchive.h> 44 #import <WebCore/WebCoreNSURLExtras.h> 44 45 #import <WebCore/Page.h> 45 46 #import <WebCore/RenderImage.h> … … 47 48 #import <WebCore/StringTruncator.h> 48 49 #import <WebKit/WebArchive.h> 49 #import <WebKit/WebKitNSStringExtras.h>50 #import <WebKit/WebNSFileManagerExtras.h>51 #import <WebKit/WebNSPasteboardExtras.h>52 #import <WebKit/WebNSURLExtras.h>53 50 #import <WebKitSystemInterface.h> 54 51 #import <wtf/StdLibExtras.h> … … 119 116 title = url.lastPathComponent(); 120 117 if (title.isEmpty()) 121 title = [(NSURL *)url _web_userVisibleString];118 title = userVisibleString((NSURL *)url); 122 119 } 123 120 … … 144 141 sharedMemoryBuffer->createHandle(archiveHandle, SharedMemory::ReadOnly); 145 142 } 146 m_page->send(Messages::WebPageProxy::SetPromisedData(pasteboardName, imageHandle, imageSize, String([response suggestedFilename]), extension, title, String([[response URL] absoluteString]), String([(NSURL *)url _web_userVisibleString]), archiveHandle, archiveSize));143 m_page->send(Messages::WebPageProxy::SetPromisedData(pasteboardName, imageHandle, imageSize, String([response suggestedFilename]), extension, title, String([[response URL] absoluteString]), userVisibleString((NSURL *)url), archiveHandle, archiveSize)); 147 144 } 148 145 -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm
r164776 r165118 47 47 #import <WebCore/NotImplemented.h> 48 48 #import <WebCore/Page.h> 49 #import <Web Kit/WebResource.h>50 #import <WebKit/Web NSURLExtras.h>49 #import <WebCore/WebCoreNSURLExtras.h> 50 #import <WebKit/WebResource.h> // FIXME: WebKit2 should not include WebKit headers. 51 51 52 52 using namespace WebCore; … … 76 76 NSString *WebEditorClient::userVisibleString(NSURL *url) 77 77 { 78 return [url _web_userVisibleString];78 return userVisibleString(url); 79 79 } 80 80 81 81 NSURL *WebEditorClient::canonicalizeURL(NSURL *url) 82 82 { 83 return [url _webkit_canonicalize];83 return URLByCanonicalizingURL(url); 84 84 } 85 85 … … 87 87 { 88 88 NSURL *URL = nil; 89 if ( [URLString _webkit_looksLikeAbsoluteURL])90 URL = [[NSURL _web_URLWithUserTypedString:URLString] _webkit_canonicalize];89 if (looksLikeAbsoluteURL(URLString)) 90 URL = URLByCanonicalizingURL(URLWithUserTypedString(URLString, nil)); 91 91 return URL; 92 92 }
Note: See TracChangeset
for help on using the changeset viewer.