Title: [91198] trunk/Source
- Revision
- 91198
- Author
- [email protected]
- Date
- 2011-07-18 11:43:08 -0700 (Mon, 18 Jul 2011)
Log Message
Part of https://bugs.webkit.org/show_bug.cgi?id=63674
Get webkit to compile with USE(CFNETWORK) enabled on Mac
Reviewed by David Kilzer.
Source/WebCore:
* WebCore.exp.in:
Source/WebKit/mac:
Create an NSURLDownload from the CF objects that we have.
* Misc/WebDownload.mm:
(-[WebDownload _initWithLoadingCFURLConnection:request:response:delegate:proxy:]):
* Misc/WebDownloadInternal.h:
* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::download):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (91197 => 91198)
--- trunk/Source/WebCore/ChangeLog 2011-07-18 18:20:11 UTC (rev 91197)
+++ trunk/Source/WebCore/ChangeLog 2011-07-18 18:43:08 UTC (rev 91198)
@@ -1,3 +1,12 @@
+2011-07-18 Pratik Solanki <[email protected]>
+
+ Part of https://bugs.webkit.org/show_bug.cgi?id=63674
+ Get webkit to compile with USE(CFNETWORK) enabled on Mac
+
+ Reviewed by David Kilzer.
+
+ * WebCore.exp.in:
+
2011-07-18 Gavin Barraclough <[email protected]>
Speculative fix for Leopard assertions caused by 91095.
Modified: trunk/Source/WebCore/WebCore.exp.in (91197 => 91198)
--- trunk/Source/WebCore/WebCore.exp.in 2011-07-18 18:20:11 UTC (rev 91197)
+++ trunk/Source/WebCore/WebCore.exp.in 2011-07-18 18:43:08 UTC (rev 91198)
@@ -357,7 +357,6 @@
__ZN7WebCore14FrameSelection6modifyENS0_11EAlterationENS_18SelectionDirectionENS_15TextGranularityENS_14EUserTriggeredE
__ZN7WebCore14FrameSelection9selectAllEv
__ZN7WebCore14FrameSelectionC1EPNS_5FrameE
-__ZN7WebCore14ResourceHandle12releaseProxyEv
__ZN7WebCore14ResourceHandle20forceContentSniffingEv
__ZN7WebCore14ResourceHandle26synchronousLoadRunLoopModeEv
__ZN7WebCore14ResourceLoader14cancelledErrorEv
@@ -1905,6 +1904,11 @@
#if USE(CFNETWORK)
__ZNK7WebCore13ResourceErrorcvP9__CFErrorEv
__ZN7WebCore12SchedulePairC1EP11__CFRunLoopPK10__CFString
+__ZNK7WebCore15ResourceRequest12cfURLRequestEv
+__ZNK7WebCore16ResourceResponse13cfURLResponseEv
+__ZN7WebCore14ResourceHandle28releaseConnectionForDownloadEv
+__ZN7WebCore15ResourceRequestC1EP12NSURLRequest
+__ZN7WebCore16ResourceResponseC1EP13NSURLResponse
_wkCFURLRequestCopyHTTPRequestBodyParts
_wkCFURLRequestSetHTTPRequestBodyParts
_wkCopyCredentialFromCFPersistentStorage
@@ -1914,4 +1918,5 @@
#else
__ZNK7WebCore13ResourceErrorcvP7NSErrorEv
__ZN7WebCore12SchedulePairC1EP9NSRunLoopPK10__CFString
+__ZN7WebCore14ResourceHandle12releaseProxyEv
#endif
Modified: trunk/Source/WebKit/mac/ChangeLog (91197 => 91198)
--- trunk/Source/WebKit/mac/ChangeLog 2011-07-18 18:20:11 UTC (rev 91197)
+++ trunk/Source/WebKit/mac/ChangeLog 2011-07-18 18:43:08 UTC (rev 91198)
@@ -1,3 +1,18 @@
+2011-07-18 Pratik Solanki <[email protected]>
+
+ Part of https://bugs.webkit.org/show_bug.cgi?id=63674
+ Get webkit to compile with USE(CFNETWORK) enabled on Mac
+
+ Reviewed by David Kilzer.
+
+ Create an NSURLDownload from the CF objects that we have.
+
+ * Misc/WebDownload.mm:
+ (-[WebDownload _initWithLoadingCFURLConnection:request:response:delegate:proxy:]):
+ * Misc/WebDownloadInternal.h:
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::download):
+
2011-07-15 Pratik Solanki <[email protected]>
Part of https://bugs.webkit.org/show_bug.cgi?id=63674
Modified: trunk/Source/WebKit/mac/Misc/WebDownload.mm (91197 => 91198)
--- trunk/Source/WebKit/mac/Misc/WebDownload.mm 2011-07-18 18:20:11 UTC (rev 91197)
+++ trunk/Source/WebKit/mac/Misc/WebDownload.mm 2011-07-18 18:43:08 UTC (rev 91198)
@@ -40,6 +40,11 @@
#import "WebTypesInternal.h"
+#if USE(CFNETWORK)
+#import <CFNetwork/CFNetwork.h>
+#import <CFNetwork/CFURLConnection.h>
+#endif
+
using namespace WebCore;
@class NSURLConnectionDelegateProxy;
@@ -55,6 +60,15 @@
- (id)_initWithRequest:(NSURLRequest *)request
delegate:(id)delegate
directory:(NSString *)directory;
+
+#if USE(CFNETWORK)
+- (id)_initWithLoadingCFURLConnection:(CFURLConnectionRef)connection
+ request:(CFURLRequestRef)request
+ response:(CFURLResponseRef)response
+ delegate:(id)delegate
+ proxy:(NSURLConnectionDelegateProxy *)proxy;
+#endif
+
@end
@interface WebDownloadInternal : NSObject <NSURLDownloadDelegate>
@@ -236,6 +250,18 @@
return [super _initWithLoadingConnection:connection request:request response:response delegate:_webInternal proxy:proxy];
}
+#if USE(CFNETWORK)
+- (id)_initWithLoadingCFURLConnection:(CFURLConnectionRef)connection
+ request:(CFURLRequestRef)request
+ response:(CFURLResponseRef)response
+ delegate:(id)delegate
+ proxy:(NSURLConnectionDelegateProxy *)proxy
+{
+ [self _setRealDelegate:delegate];
+ return [super _initWithLoadingCFURLConnection:connection request:request response:response delegate:_webInternal proxy:proxy];
+}
+#endif
+
- (id)_initWithRequest:(NSURLRequest *)request
delegate:(id)delegate
directory:(NSString *)directory
Modified: trunk/Source/WebKit/mac/Misc/WebDownloadInternal.h (91197 => 91198)
--- trunk/Source/WebKit/mac/Misc/WebDownloadInternal.h 2011-07-18 18:20:11 UTC (rev 91197)
+++ trunk/Source/WebKit/mac/Misc/WebDownloadInternal.h 2011-07-18 18:43:08 UTC (rev 91198)
@@ -27,6 +27,10 @@
*/
#import <WebKit/WebDownload.h>
+
+#if USE(CFNETWORK)
+#import <CFNetwork/CFURLConnection.h>
+#endif
@interface WebDownload (WebDownloadCreation)
+(id)_downloadWithLoadingConnection:(NSURLConnection *)connection
@@ -38,4 +42,13 @@
+(id)_downloadWithRequest:(NSURLRequest *)request
delegate:(id)delegate
directory:(NSString *)directory;
+
+#if USE(CFNETWORK)
++ (id)_downloadWithLoadingCFURLConnection:(CFURLConnectionRef)connection
+ request:(CFURLRequestRef)request
+ response:(CFURLResponseRef)response
+ delegate:(id)delegate
+ proxy:(id)proxy;
+#endif
+
@end
Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm (91197 => 91198)
--- trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm 2011-07-18 18:20:11 UTC (rev 91197)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm 2011-07-18 18:43:08 UTC (rev 91198)
@@ -287,6 +287,21 @@
void WebFrameLoaderClient::download(ResourceHandle* handle, const ResourceRequest& request, const ResourceRequest& initialRequest, const ResourceResponse& response)
{
+#if USE(CFNETWORK)
+ ASSERT([WebDownload respondsToSelector:@selector(_downloadWithLoadingCFURLConnection:request:response:delegate:proxy:)]);
+ WebView *webView = getWebView(m_webFrame.get());
+ CFURLConnectionRef connection = handle->connection();
+ WebDownload *download = [WebDownload _downloadWithLoadingCFURLConnection:connection
+ request:request.cfURLRequest()
+ response:response.cfURLResponse()
+ delegate:[webView downloadDelegate]
+ proxy:nil];
+ setOriginalURLForDownload(download, initialRequest);
+
+ // Release the connection since the NSURLDownload (actually CFURLDownload) will retain the connection and use it.
+ handle->releaseConnectionForDownload();
+ CFRelease(connection);
+#else
id proxy = handle->releaseProxy();
ASSERT(proxy);
@@ -298,6 +313,7 @@
proxy:proxy];
setOriginalURLForDownload(download, initialRequest);
+#endif
}
void WebFrameLoaderClient::setOriginalURLForDownload(WebDownload *download, const ResourceRequest& initialRequest) const
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes