<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[165118] trunk/Source</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/165118">165118</a></dd>
<dt>Author</dt> <dd>simon.fraser@apple.com</dd>
<dt>Date</dt> <dd>2014-03-05 12:16:10 -0800 (Wed, 05 Mar 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>ObjC exception when dropping files into a WKView: drag and drop uses code from WebKit.framework
https://bugs.webkit.org/show_bug.cgi?id=129752
Source/WebCore:
Reviewed by Enrica Casucci.
Add C functions for NSURL-related functionality required by WebKit2
* WebCore.exp.in:
* platform/mac/WebCoreNSURLExtras.h:
* platform/mac/WebCoreNSURLExtras.mm:
(WebCore::URLByCanonicalizingURL):
(WebCore::rangeOfURLScheme):
(WebCore::looksLikeAbsoluteURL):
Source/WebKit/mac:
Reviewed by Enrica Casucci.
Call URLByCanonicalizingURL() which is implemented in WebCore.
* Misc/WebNSURLExtras.mm:
(-[NSURL _webkit_canonicalize]):
Source/WebKit2:
Reviewed by Enrica Casucci.
Get WebDragClientMac off of all WebKit headers, and WebEditorClientMac off
all but one by using C functions from WebCoreNSURLExtras.h rather than
the NSURL category.
* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
(WebKit::WebDragClient::declareAndWriteDragImage):
* WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
(WebKit::WebEditorClient::userVisibleString):
(WebKit::WebEditorClient::canonicalizeURL):
(WebKit::WebEditorClient::canonicalizeURLString):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#trunkSourceWebCoreplatformmacWebCoreNSURLExtrash">trunk/Source/WebCore/platform/mac/WebCoreNSURLExtras.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmacWebCoreNSURLExtrasmm">trunk/Source/WebCore/platform/mac/WebCoreNSURLExtras.mm</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacMiscWebNSURLExtrasmm">trunk/Source/WebKit/mac/Misc/WebNSURLExtras.mm</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportmacWebDragClientMacmm">trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportmacWebEditorClientMacmm">trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (165117 => 165118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-03-05 20:11:03 UTC (rev 165117)
+++ trunk/Source/WebCore/ChangeLog        2014-03-05 20:16:10 UTC (rev 165118)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2014-03-05 Simon Fraser <simon.fraser@apple.com>
+
+ ObjC exception when dropping files into a WKView: drag and drop uses code from WebKit.framework
+ https://bugs.webkit.org/show_bug.cgi?id=129752
+
+ Reviewed by Enrica Casucci.
+
+ Add C functions for NSURL-related functionality required by WebKit2
+
+ * WebCore.exp.in:
+ * platform/mac/WebCoreNSURLExtras.h:
+ * platform/mac/WebCoreNSURLExtras.mm:
+ (WebCore::URLByCanonicalizingURL):
+ (WebCore::rangeOfURLScheme):
+ (WebCore::looksLikeAbsoluteURL):
+
</ins><span class="cx"> 2014-03-05 Martin Hock <mhock@apple.com>
</span><span class="cx">
</span><span class="cx"> Add support for sessions to MemoryCache.
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (165117 => 165118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2014-03-05 20:11:03 UTC (rev 165117)
+++ trunk/Source/WebCore/WebCore.exp.in        2014-03-05 20:16:10 UTC (rev 165118)
</span><span class="lines">@@ -75,6 +75,7 @@
</span><span class="cx"> __ZN7WebCore10FloatPointC1ERKNS_8IntPointE
</span><span class="cx"> __ZN7WebCore10FontGlyphs15releaseFontDataEv
</span><span class="cx"> __ZN7WebCore10JSDocument6s_infoE
</span><ins>+__ZN7WebCore10LayoutRectC1ERKNS_9FloatRectE
</ins><span class="cx"> __ZN7WebCore10MouseEvent6createERKN3WTF12AtomicStringENS1_10PassRefPtrINS_9DOMWindowEEERKNS_18PlatformMouseEventEiNS5_INS_4NodeEEE
</span><span class="cx"> __ZN7WebCore10MouseEvent6createERKN3WTF12AtomicStringEbbdNS1_10PassRefPtrINS_9DOMWindowEEEiiiiibbbbtNS5_INS_11EventTargetEEENS5_INS_9ClipboardEEEb
</span><span class="cx"> __ZN7WebCore10Pasteboard14writePlainTextERKN3WTF6StringENS0_18SmartReplaceOptionE
</span><span class="lines">@@ -833,6 +834,7 @@
</span><span class="cx"> __ZN7WebCore20UserGestureIndicatorC1ENS_26ProcessingUserGestureStateE
</span><span class="cx"> __ZN7WebCore20UserGestureIndicatorD1Ev
</span><span class="cx"> __ZN7WebCore20deleteEmptyDirectoryERKN3WTF6StringE
</span><ins>+__ZN7WebCore20looksLikeAbsoluteURLEP8NSString
</ins><span class="cx"> __ZN7WebCore20makeRGBA32FromFloatsEffff
</span><span class="cx"> __ZN7WebCore20previousLinePositionERKNS_15VisiblePositionEiNS_12EditableTypeE
</span><span class="cx"> __ZN7WebCore20protocolIsJavaScriptERKN3WTF6StringE
</span><span class="lines">@@ -894,6 +896,7 @@
</span><span class="cx"> __ZN7WebCore22ScriptExecutionContext26canSuspendActiveDOMObjectsEv
</span><span class="cx"> __ZN7WebCore22ScriptExecutionContext2vmEv
</span><span class="cx"> __ZN7WebCore22StorageEventDispatcher34dispatchLocalStorageEventsToFramesERNS_9PageGroupERKN3WTF6VectorINS3_6RefPtrINS_5FrameEEELm0ENS3_15CrashOnOverflowEEERKNS3_6StringESE_SE_SE_PNS_14SecurityOriginE
</span><ins>+__ZN7WebCore22URLByCanonicalizingURLEP5NSURL
</ins><span class="cx"> __ZN7WebCore22URLWithUserTypedStringEP8NSStringP5NSURL
</span><span class="cx"> __ZN7WebCore22WheelEventDeltaTracker17endTrackingDeltasEv
</span><span class="cx"> __ZN7WebCore22WheelEventDeltaTracker19beginTrackingDeltasEv
</span><span class="lines">@@ -1932,7 +1935,6 @@
</span><span class="cx"> __ZTVN7WebCore28InspectorFrontendClientLocal8SettingsE
</span><span class="cx"> __ZTVN7WebCore31BasicColorMatrixFilterOperationE
</span><span class="cx"> __ZTVN7WebCore37BasicComponentTransferFilterOperationE
</span><del>-__ZN7WebCore10LayoutRectC1ERKNS_9FloatRectE
</del><span class="cx"> __ZThn???_N7WebCore15GraphicsLayerCA28platformCALayerPaintContentsEPNS_15PlatformCALayerERNS_15GraphicsContextERKNS_9FloatRectE
</span><span class="cx"> __ZThn???_N7WebCore15GraphicsLayerCA31platformCALayerAnimationStartedEd
</span><span class="cx"> __ZThn???_N7WebCore15GraphicsLayerCA40platformCALayerSetNeedsToRevalidateTilesEv
</span><span class="lines">@@ -2314,6 +2316,10 @@
</span><span class="cx"> _wkCreateMemoryStatusPressureCriticalDispatchOnMainQueue
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+#if PLATFORM(MAC) || PLATFORM(IOS_SIMULATOR)
+_wkSetCrashReportApplicationSpecificInformation
+#endif
+
</ins><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> .objc_class_name_NSCursor
</span><span class="cx"> .objc_class_name_WAKClipView
</span><span class="lines">@@ -2446,7 +2452,6 @@
</span><span class="cx"> __ZN7WebCore15GraphicsContext12drawBidiTextERKNS_4FontERKNS_7TextRunERKNS_10FloatPointENS1_24CustomFontNotReadyActionEPNS_10BidiStatusEi
</span><span class="cx"> __ZN7WebCore15GraphicsContext15drawLineForTextERKNS_10FloatPointEfbb
</span><span class="cx"> __ZN7WebCore15GraphicsContext15drawNativeImageEP7CGImageRKNS_9FloatSizeENS_10ColorSpaceERKNS_9FloatRectES9_fNS_17CompositeOperatorENS_9BlendModeENS_16ImageOrientationE
</span><del>-__ZN7WebCore15GraphicsContext15drawLineForTextERKNS_10FloatPointEfbb
</del><span class="cx"> __ZN7WebCore15GraphicsContext22setEmojiDrawingEnabledEb
</span><span class="cx"> __ZN7WebCore15GraphicsContext23setIsAcceleratedContextEb
</span><span class="cx"> __ZN7WebCore15GraphicsContextC1EP9CGContextb
</span><span class="lines">@@ -2685,10 +2690,6 @@
</span><span class="cx"> _wkIOSurfaceContextCreateImage
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-#if PLATFORM(MAC) || PLATFORM(IOS_SIMULATOR)
-_wkSetCrashReportApplicationSpecificInformation
-#endif
-
</del><span class="cx"> #if ENABLE(3D_RENDERING)
</span><span class="cx"> _WebCoreHas3DRendering
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacWebCoreNSURLExtrash"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/WebCoreNSURLExtras.h (165117 => 165118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/WebCoreNSURLExtras.h        2014-03-05 20:11:03 UTC (rev 165117)
+++ trunk/Source/WebCore/platform/mac/WebCoreNSURLExtras.h        2014-03-05 20:16:10 UTC (rev 165118)
</span><span class="lines">@@ -39,6 +39,7 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> NSString *userVisibleString(NSURL *);
</span><ins>+NSURL *URLByCanonicalizingURL(NSURL *);
</ins><span class="cx"> NSURL *URLWithUserTypedString(NSString *, NSURL *);
</span><span class="cx"> NSURL *URLByRemovingUserInfo(NSURL *);
</span><span class="cx"> BOOL hostNameNeedsDecodingWithRange(NSString *, NSRange);
</span><span class="lines">@@ -51,6 +52,9 @@
</span><span class="cx"> NSURL *URLWithData(NSData *, NSURL *baseURL);
</span><span class="cx"> NSData *originalURLData(NSURL *);
</span><span class="cx"> NSData *dataForURLComponentType(NSURL *, CFIndex);
</span><ins>+
+NSRange rangeOfURLScheme(NSString *);
</ins><span class="cx"> BOOL isUserVisibleURL(NSString *);
</span><del>-
</del><ins>+BOOL looksLikeAbsoluteURL(NSString *);
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacWebCoreNSURLExtrasmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/WebCoreNSURLExtras.mm (165117 => 165118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/WebCoreNSURLExtras.mm        2014-03-05 20:11:03 UTC (rev 165117)
+++ trunk/Source/WebCore/platform/mac/WebCoreNSURLExtras.mm        2014-03-05 20:16:10 UTC (rev 165118)
</span><span class="lines">@@ -48,6 +48,11 @@
</span><span class="cx"> static pthread_once_t IDNScriptWhiteListFileRead = PTHREAD_ONCE_INIT;
</span><span class="cx"> static uint32_t IDNScriptWhiteList[(USCRIPT_CODE_LIMIT + 31) / 32];
</span><span class="cx">
</span><ins>+
+@interface NSURLProtocol (WKNSURLProtocolInternal)
++ (Class)_protocolClassForRequest:(NSURLRequest *)request;
+@end
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> static inline BOOL isLookalikeCharacter(int charCode)
</span><span class="lines">@@ -712,6 +717,23 @@
</span><span class="cx"> return URLByRemovingComponentAndSubsequentCharacter(URL, kCFURLComponentUserInfo);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+NSURL *URLByCanonicalizingURL(NSURL *URL)
+{
+ RetainPtr<NSURLRequest> request = adoptNS([[NSURLRequest alloc] initWithURL:URL]);
+ Class concreteClass = [NSURLProtocol _protocolClassForRequest:request.get()];
+ if (!concreteClass) {
+ return URL;
+ }
+
+ // This applies NSURL's concept of canonicalization, but not URL's concept. It would
+ // make sense to apply both, but when we tried that it caused a performance degradation
+ // (see 5315926). It might make sense to apply only the URL concept and not the NSURL
+ // concept, but it's too risky to make that change for WebKit 3.0.
+ NSURLRequest *newRequest = [concreteClass canonicalRequestForRequest:request.get()];
+ NSURL *newURL = [newRequest URL];
+ return [[newURL retain] autorelease];
+}
+
</ins><span class="cx"> NSData *originalURLData(NSURL *URL)
</span><span class="cx"> {
</span><span class="cx"> UInt8 *buffer = (UInt8 *)malloc(URL_BYTES_BUFFER_LENGTH);
</span><span class="lines">@@ -880,4 +902,32 @@
</span><span class="cx"> return valid;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+NSRange rangeOfURLScheme(NSString *string)
+{
+ NSRange colon = [string rangeOfString:@":"];
+ if (colon.location != NSNotFound && colon.location > 0) {
+ NSRange scheme = {0, colon.location};
+ static NSCharacterSet *InverseSchemeCharacterSet = nil;
+ if (!InverseSchemeCharacterSet) {
+ /*
+ This stuff is very expensive. 10-15 msec on a 2x1.2GHz. If not cached it swamps
+ everything else when adding items to the autocomplete DB. Makes me wonder if we
+ even need to enforce the character set here.
+ */
+ NSString *acceptableCharacters = @"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+.-";
+ InverseSchemeCharacterSet = [[[NSCharacterSet characterSetWithCharactersInString:acceptableCharacters] invertedSet] retain];
+ }
+ NSRange illegals = [string rangeOfCharacterFromSet:InverseSchemeCharacterSet options:0 range:scheme];
+ if (illegals.location == NSNotFound)
+ return scheme;
+ }
+ return NSMakeRange(NSNotFound, 0);
+}
+
+BOOL looksLikeAbsoluteURL(NSString *string)
+{
+ // Trim whitespace because _web_URLWithString allows whitespace.
+ return rangeOfURLScheme(stringByTrimmingWhitespace(string)).location != NSNotFound;
+}
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (165117 => 165118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2014-03-05 20:11:03 UTC (rev 165117)
+++ trunk/Source/WebKit/mac/ChangeLog        2014-03-05 20:16:10 UTC (rev 165118)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2014-03-05 Simon Fraser <simon.fraser@apple.com>
+
+ ObjC exception when dropping files into a WKView: drag and drop uses code from WebKit.framework
+ https://bugs.webkit.org/show_bug.cgi?id=129752
+
+ Reviewed by Enrica Casucci.
+
+ Call URLByCanonicalizingURL() which is implemented in WebCore.
+
+ * Misc/WebNSURLExtras.mm:
+ (-[NSURL _webkit_canonicalize]):
+
</ins><span class="cx"> 2014-03-04 Zalan Bujtas <zalan@apple.com>
</span><span class="cx">
</span><span class="cx"> Enable device pixel repaint rect tracking.
</span></span></pre></div>
<a id="trunkSourceWebKitmacMiscWebNSURLExtrasmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/Misc/WebNSURLExtras.mm (165117 => 165118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/Misc/WebNSURLExtras.mm        2014-03-05 20:11:03 UTC (rev 165117)
+++ trunk/Source/WebKit/mac/Misc/WebNSURLExtras.mm        2014-03-05 20:16:10 UTC (rev 165118)
</span><span class="lines">@@ -128,24 +128,8 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (NSURL *)_webkit_canonicalize
</span><del>-{
- NSURLRequest *request = [[NSURLRequest alloc] initWithURL:self];
- Class concreteClass = WKNSURLProtocolClassForRequest(request);
- if (!concreteClass) {
- [request release];
- return self;
- }
-
- // This applies NSURL's concept of canonicalization, but not URL's concept. It would
- // make sense to apply both, but when we tried that it caused a performance degradation
- // (see 5315926). It might make sense to apply only the URL concept and not the NSURL
- // concept, but it's too risky to make that change for WebKit 3.0.
- NSURLRequest *newRequest = [concreteClass canonicalRequestForRequest:request];
- NSURL *newURL = [newRequest URL];
- NSURL *result = [[newURL retain] autorelease];
- [request release];
-
- return result;
</del><ins>+{
+ return URLByCanonicalizingURL(self);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (NSURL *)_web_URLByTruncatingOneCharacterBeforeComponent:(CFURLComponentType)component
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (165117 => 165118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-03-05 20:11:03 UTC (rev 165117)
+++ trunk/Source/WebKit2/ChangeLog        2014-03-05 20:16:10 UTC (rev 165118)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2014-03-05 Simon Fraser <simon.fraser@apple.com>
+
+ ObjC exception when dropping files into a WKView: drag and drop uses code from WebKit.framework
+ https://bugs.webkit.org/show_bug.cgi?id=129752
+
+ Reviewed by Enrica Casucci.
+
+ Get WebDragClientMac off of all WebKit headers, and WebEditorClientMac off
+ all but one by using C functions from WebCoreNSURLExtras.h rather than
+ the NSURL category.
+
+ * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
+ (WebKit::WebDragClient::declareAndWriteDragImage):
+ * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
+ (WebKit::WebEditorClient::userVisibleString):
+ (WebKit::WebEditorClient::canonicalizeURL):
+ (WebKit::WebEditorClient::canonicalizeURLString):
+
</ins><span class="cx"> 2014-03-05 Martin Hock <mhock@apple.com>
</span><span class="cx">
</span><span class="cx"> Add support for sessions to MemoryCache.
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportmacWebDragClientMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm (165117 => 165118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm        2014-03-05 20:11:03 UTC (rev 165117)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm        2014-03-05 20:16:10 UTC (rev 165118)
</span><span class="lines">@@ -41,15 +41,12 @@
</span><span class="cx"> #import <WebCore/FrameView.h>
</span><span class="cx"> #import <WebCore/GraphicsContext.h>
</span><span class="cx"> #import <WebCore/LegacyWebArchive.h>
</span><ins>+#import <WebCore/WebCoreNSURLExtras.h>
</ins><span class="cx"> #import <WebCore/Page.h>
</span><span class="cx"> #import <WebCore/RenderImage.h>
</span><span class="cx"> #import <WebCore/ResourceHandle.h>
</span><span class="cx"> #import <WebCore/StringTruncator.h>
</span><span class="cx"> #import <WebKit/WebArchive.h>
</span><del>-#import <WebKit/WebKitNSStringExtras.h>
-#import <WebKit/WebNSFileManagerExtras.h>
-#import <WebKit/WebNSPasteboardExtras.h>
-#import <WebKit/WebNSURLExtras.h>
</del><span class="cx"> #import <WebKitSystemInterface.h>
</span><span class="cx"> #import <wtf/StdLibExtras.h>
</span><span class="cx">
</span><span class="lines">@@ -118,7 +115,7 @@
</span><span class="cx"> if (title.isEmpty()) {
</span><span class="cx"> title = url.lastPathComponent();
</span><span class="cx"> if (title.isEmpty())
</span><del>- title = [(NSURL *)url _web_userVisibleString];
</del><ins>+ title = userVisibleString((NSURL *)url);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> RefPtr<LegacyWebArchive> archive = LegacyWebArchive::create(&element);
</span><span class="lines">@@ -143,7 +140,7 @@
</span><span class="cx"> memcpy(sharedMemoryBuffer->data(), buffer->data(), archiveSize);
</span><span class="cx"> sharedMemoryBuffer->createHandle(archiveHandle, SharedMemory::ReadOnly);
</span><span class="cx"> }
</span><del>- 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));
</del><ins>+ m_page->send(Messages::WebPageProxy::SetPromisedData(pasteboardName, imageHandle, imageSize, String([response suggestedFilename]), extension, title, String([[response URL] absoluteString]), userVisibleString((NSURL *)url), archiveHandle, archiveSize));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportmacWebEditorClientMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm (165117 => 165118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm        2014-03-05 20:11:03 UTC (rev 165117)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm        2014-03-05 20:16:10 UTC (rev 165118)
</span><span class="lines">@@ -46,8 +46,8 @@
</span><span class="cx"> #import <WebCore/KeyboardEvent.h>
</span><span class="cx"> #import <WebCore/NotImplemented.h>
</span><span class="cx"> #import <WebCore/Page.h>
</span><del>-#import <WebKit/WebResource.h>
-#import <WebKit/WebNSURLExtras.h>
</del><ins>+#import <WebCore/WebCoreNSURLExtras.h>
+#import <WebKit/WebResource.h> // FIXME: WebKit2 should not include WebKit headers.
</ins><span class="cx">
</span><span class="cx"> using namespace WebCore;
</span><span class="cx">
</span><span class="lines">@@ -75,19 +75,19 @@
</span><span class="cx">
</span><span class="cx"> NSString *WebEditorClient::userVisibleString(NSURL *url)
</span><span class="cx"> {
</span><del>- return [url _web_userVisibleString];
</del><ins>+ return userVisibleString(url);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> NSURL *WebEditorClient::canonicalizeURL(NSURL *url)
</span><span class="cx"> {
</span><del>- return [url _webkit_canonicalize];
</del><ins>+ return URLByCanonicalizingURL(url);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> NSURL *WebEditorClient::canonicalizeURLString(NSString *URLString)
</span><span class="cx"> {
</span><span class="cx"> NSURL *URL = nil;
</span><del>- if ([URLString _webkit_looksLikeAbsoluteURL])
- URL = [[NSURL _web_URLWithUserTypedString:URLString] _webkit_canonicalize];
</del><ins>+ if (looksLikeAbsoluteURL(URLString))
+ URL = URLByCanonicalizingURL(URLWithUserTypedString(URLString, nil));
</ins><span class="cx"> return URL;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>