[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

andersca at apple.com andersca at apple.com
Wed Dec 22 15:46:22 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit e5d9fce5ff9761efe8b8218f1cd7ee050bf0d6ab
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Nov 12 01:33:05 2010 +0000

    Add didReceiveResponse and didReceiveData to the download client
    https://bugs.webkit.org/show_bug.cgi?id=49418
    
    Reviewed by Darin Adler.
    
    * UIProcess/API/C/WKContext.h:
    Add didReceiveResponse and didReceiveData to WKContextDownloadClient.
    
    * UIProcess/Downloads/DownloadProxy.cpp:
    (WebKit::DownloadProxy::didReceiveResponse):
    (WebKit::DownloadProxy::didReceiveData):
    Call WebDownloadClient member functions.
    
    * UIProcess/Downloads/DownloadProxy.messages.in:
    Add DidReceiveResponse and DidReceiveData messages.
    
    * UIProcess/WebDownloadClient.cpp:
    (WebKit::WebDownloadClient::didReceiveResponse):
    (WebKit::WebDownloadClient::didReceiveData):
    Call client functions.
    
    * WebKit2.xcodeproj/project.pbxproj:
    Let Xcode update the file.
    
    * WebProcess/Downloads/Download.cpp:
    (WebKit::Download::didReceiveResponse):
    (WebKit::Download::didReceiveData):
    Send messages.
    
    * WebProcess/Downloads/mac/DownloadMac.mm:
    (WebKit::Download::start):
    Set deletesFileUponFailure to NO.
    
    (-[WKDownloadAsDelegate download:didReceiveResponse:]):
    Call didReceiveResponse.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71872 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index c335288..b7980f0 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,5 +1,43 @@
 2010-11-11  Anders Carlsson  <andersca at apple.com>
 
+        Reviewed by Darin Adler.
+
+        Add didReceiveResponse and didReceiveData to the download client
+        https://bugs.webkit.org/show_bug.cgi?id=49418
+
+        * UIProcess/API/C/WKContext.h:
+        Add didReceiveResponse and didReceiveData to WKContextDownloadClient.
+
+        * UIProcess/Downloads/DownloadProxy.cpp:
+        (WebKit::DownloadProxy::didReceiveResponse):
+        (WebKit::DownloadProxy::didReceiveData):
+        Call WebDownloadClient member functions.
+
+        * UIProcess/Downloads/DownloadProxy.messages.in:
+        Add DidReceiveResponse and DidReceiveData messages.
+
+        * UIProcess/WebDownloadClient.cpp:
+        (WebKit::WebDownloadClient::didReceiveResponse):
+        (WebKit::WebDownloadClient::didReceiveData):
+        Call client functions.
+
+        * WebKit2.xcodeproj/project.pbxproj:
+        Let Xcode update the file.
+
+        * WebProcess/Downloads/Download.cpp:
+        (WebKit::Download::didReceiveResponse):
+        (WebKit::Download::didReceiveData):
+        Send messages.
+
+        * WebProcess/Downloads/mac/DownloadMac.mm:
+        (WebKit::Download::start):
+        Set deletesFileUponFailure to NO.
+
+        (-[WKDownloadAsDelegate download:didReceiveResponse:]):
+        Call didReceiveResponse.
+
+2010-11-11  Anders Carlsson  <andersca at apple.com>
+
         Reviewed by Sam Weinig.
 
         Add an argument coder for ResourceResponse.
diff --git a/WebKit2/UIProcess/API/C/WKContext.h b/WebKit2/UIProcess/API/C/WKContext.h
index d8800dd..2159bf4 100644
--- a/WebKit2/UIProcess/API/C/WKContext.h
+++ b/WebKit2/UIProcess/API/C/WKContext.h
@@ -71,13 +71,17 @@ typedef struct WKContextHistoryClient WKContextHistoryClient;
 
 // Download Client
 typedef void (*WKContextDownloadDidStartCallback)(WKContextRef context, WKDownloadRef download, const void *clientInfo);
-typedef void (*WKContextDownloadDidFinishCallback)(WKContextRef context, WKDownloadRef download, const void *clientInfo);
+typedef void (*WKContextDownloadDidReceiveResponseCallback)(WKContextRef context, WKDownloadRef download, WKURLResponseRef response, const void *clientInfo);
+typedef void (*WKContextDownloadDidReceiveDataCallback)(WKContextRef context, WKDownloadRef download, uint64_t length, const void *clientInfo);
 typedef void (*WKContextDownloadDidCreateDestinationCallback)(WKContextRef context, WKDownloadRef download, WKStringRef path, const void *clientInfo);
+typedef void (*WKContextDownloadDidFinishCallback)(WKContextRef context, WKDownloadRef download, const void *clientInfo);
 
 struct WKContextDownloadClient {
     int                                                                 version;
     const void *                                                        clientInfo;
     WKContextDownloadDidStartCallback                                   didStart;
+    WKContextDownloadDidReceiveResponseCallback                         didReceiveResponse;
+    WKContextDownloadDidReceiveDataCallback                             didReceiveData;
     WKContextDownloadDidCreateDestinationCallback                       didCreateDestination;
     WKContextDownloadDidFinishCallback                                  didFinish;
 };
diff --git a/WebKit2/UIProcess/Downloads/DownloadProxy.cpp b/WebKit2/UIProcess/Downloads/DownloadProxy.cpp
index 5d8890e..d0cef44 100644
--- a/WebKit2/UIProcess/Downloads/DownloadProxy.cpp
+++ b/WebKit2/UIProcess/Downloads/DownloadProxy.cpp
@@ -71,6 +71,22 @@ void DownloadProxy::didStart(const ResourceRequest& request)
     m_webContext->downloadClient().didStart(m_webContext, this);
 }
 
+void DownloadProxy::didReceiveResponse(const ResourceResponse& response)
+{
+    if (!m_webContext)
+        return;
+
+    m_webContext->downloadClient().didReceiveResponse(m_webContext, this, response);
+}
+
+void DownloadProxy::didReceiveData(uint64_t length)
+{
+    if (!m_webContext)
+        return;
+
+    m_webContext->downloadClient().didReceiveData(m_webContext, this, length);
+}
+
 void DownloadProxy::didCreateDestination(const String& path)
 {
     if (!m_webContext)
diff --git a/WebKit2/UIProcess/Downloads/DownloadProxy.h b/WebKit2/UIProcess/Downloads/DownloadProxy.h
index 29f012c..e918406 100644
--- a/WebKit2/UIProcess/Downloads/DownloadProxy.h
+++ b/WebKit2/UIProcess/Downloads/DownloadProxy.h
@@ -37,6 +37,10 @@ namespace CoreIPC {
     class MessageID;
 }
 
+namespace WebCore {
+    class ResourceResponse;
+}
+
 namespace WebKit {
 
 class WebContext;
@@ -62,6 +66,8 @@ private:
 
     // Message handlers.
     void didStart(const WebCore::ResourceRequest&);
+    void didReceiveResponse(const WebCore::ResourceResponse&);
+    void didReceiveData(uint64_t length);
     void didCreateDestination(const String& path);
     void didFinish();
 
diff --git a/WebKit2/UIProcess/Downloads/DownloadProxy.messages.in b/WebKit2/UIProcess/Downloads/DownloadProxy.messages.in
index 463fb38..7d357c7 100644
--- a/WebKit2/UIProcess/Downloads/DownloadProxy.messages.in
+++ b/WebKit2/UIProcess/Downloads/DownloadProxy.messages.in
@@ -22,6 +22,8 @@
 
 messages -> DownloadProxy {
     DidStart(WebCore::ResourceRequest request)
+    DidReceiveResponse(WebCore::ResourceResponse response)
+    DidReceiveData(uint64_t length)
     DidCreateDestination(WTF::String path)
     DidFinish()
 }
diff --git a/WebKit2/UIProcess/WebDownloadClient.cpp b/WebKit2/UIProcess/WebDownloadClient.cpp
index 7ab41d9..1eb4165 100644
--- a/WebKit2/UIProcess/WebDownloadClient.cpp
+++ b/WebKit2/UIProcess/WebDownloadClient.cpp
@@ -26,6 +26,9 @@
 #include "WebDownloadClient.h"
 
 #include "WKAPICast.h"
+#include "WebURLResponse.h"
+
+using namespace WebCore;
 
 namespace WebKit {
 
@@ -37,6 +40,22 @@ void WebDownloadClient::didStart(WebContext* webContext, DownloadProxy* download
     m_client.didStart(toAPI(webContext), toAPI(downloadProxy), m_client.clientInfo);
 }
 
+void WebDownloadClient::didReceiveResponse(WebContext* webContext, DownloadProxy* downloadProxy, const ResourceResponse& response)
+{
+    if (!m_client.didReceiveResponse)
+        return;
+
+    m_client.didReceiveResponse(toAPI(webContext), toAPI(downloadProxy), toAPI(WebURLResponse::create(response).get()), m_client.clientInfo);
+}
+
+void WebDownloadClient::didReceiveData(WebContext* webContext, DownloadProxy* downloadProxy, uint64_t length)
+{
+    if (!m_client.didReceiveData)
+        return;
+
+    m_client.didReceiveData(toAPI(webContext), toAPI(downloadProxy), length, m_client.clientInfo);
+}
+
 void WebDownloadClient::didCreateDestination(WebContext* webContext, DownloadProxy* downloadProxy, const String& path)
 {
     if (!m_client.didCreateDestination)
diff --git a/WebKit2/UIProcess/WebDownloadClient.h b/WebKit2/UIProcess/WebDownloadClient.h
index ba01861..3d9968e 100644
--- a/WebKit2/UIProcess/WebDownloadClient.h
+++ b/WebKit2/UIProcess/WebDownloadClient.h
@@ -30,6 +30,10 @@
 #include "WKContext.h"
 #include <wtf/Forward.h>
 
+namespace WebCore {
+    class ResourceResponse;
+}
+
 namespace WebKit {
 
 class DownloadProxy;
@@ -38,6 +42,8 @@ class WebContext;
 class WebDownloadClient : public APIClient<WKContextDownloadClient> {
 public:
     void didStart(WebContext*, DownloadProxy*);
+    void didReceiveResponse(WebContext*, DownloadProxy*, const WebCore::ResourceResponse&);
+    void didReceiveData(WebContext*, DownloadProxy*, uint64_t length);
     void didCreateDestination(WebContext*, DownloadProxy*, const String& path);
     void didFinish(WebContext*, DownloadProxy*);
 };
diff --git a/WebKit2/WebKit2.xcodeproj/project.pbxproj b/WebKit2/WebKit2.xcodeproj/project.pbxproj
index 6846f33..67014d6 100644
--- a/WebKit2/WebKit2.xcodeproj/project.pbxproj
+++ b/WebKit2/WebKit2.xcodeproj/project.pbxproj
@@ -189,16 +189,16 @@
 		1C8E293A12761E5B00BC7BD0 /* WKInspector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C8E293812761E5B00BC7BD0 /* WKInspector.cpp */; };
 		1C8E2A351277852400BC7BD0 /* WebInspectorMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C8E2A311277852400BC7BD0 /* WebInspectorMessageReceiver.cpp */; };
 		1C8E2A361277852400BC7BD0 /* WebInspectorMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C8E2A321277852400BC7BD0 /* WebInspectorMessages.h */; };
+		1CA8B936127C774E00576C2B /* WebInspectorProxyMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1CA8B935127C774E00576C2B /* WebInspectorProxyMac.mm */; };
+		1CA8B945127C882A00576C2B /* WebInspectorProxyMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1CA8B943127C882A00576C2B /* WebInspectorProxyMessageReceiver.cpp */; };
+		1CA8B946127C882A00576C2B /* WebInspectorProxyMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CA8B944127C882A00576C2B /* WebInspectorProxyMessages.h */; };
+		1CA8B954127C891500576C2B /* WebInspectorMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1C8E2DAD1278C5B200BC7BD0 /* WebInspectorMac.mm */; };
 		510FBB9A1288C95E00AFFDF4 /* WebContextMenuItemData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 510FBB981288C95E00AFFDF4 /* WebContextMenuItemData.cpp */; };
 		510FBB9B1288C95E00AFFDF4 /* WebContextMenuItemData.h in Headers */ = {isa = PBXBuildFile; fileRef = 510FBB991288C95E00AFFDF4 /* WebContextMenuItemData.h */; };
 		512935D71288D19400A4B695 /* WebContextMenuItem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 512935D51288D19400A4B695 /* WebContextMenuItem.cpp */; };
 		512935D81288D19400A4B695 /* WebContextMenuItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 512935D61288D19400A4B695 /* WebContextMenuItem.h */; };
 		512935E31288D97800A4B695 /* InjectedBundlePageContextMenuClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 512935E11288D97800A4B695 /* InjectedBundlePageContextMenuClient.cpp */; };
 		512935E41288D97800A4B695 /* InjectedBundlePageContextMenuClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 512935E21288D97800A4B695 /* InjectedBundlePageContextMenuClient.h */; };
-		1CA8B936127C774E00576C2B /* WebInspectorProxyMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1CA8B935127C774E00576C2B /* WebInspectorProxyMac.mm */; };
-		1CA8B945127C882A00576C2B /* WebInspectorProxyMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1CA8B943127C882A00576C2B /* WebInspectorProxyMessageReceiver.cpp */; };
-		1CA8B946127C882A00576C2B /* WebInspectorProxyMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CA8B944127C882A00576C2B /* WebInspectorProxyMessages.h */; };
-		1CA8B954127C891500576C2B /* WebInspectorMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1C8E2DAD1278C5B200BC7BD0 /* WebInspectorMac.mm */; };
 		51578B831209ECEF00A37C4A /* WebData.h in Headers */ = {isa = PBXBuildFile; fileRef = 51578B821209ECEF00A37C4A /* WebData.h */; };
 		516A4A5D120A2CCD00C05B7F /* WebError.h in Headers */ = {isa = PBXBuildFile; fileRef = 516A4A5B120A2CCD00C05B7F /* WebError.h */; };
 		51871B5B127CB89D00F76232 /* WebContextMenu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51871B59127CB89D00F76232 /* WebContextMenu.cpp */; };
@@ -747,7 +747,7 @@
 		1C8E2A1C1277833F00BC7BD0 /* WebInspector.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebInspector.messages.in; sourceTree = "<group>"; };
 		1C8E2A311277852400BC7BD0 /* WebInspectorMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebInspectorMessageReceiver.cpp; sourceTree = "<group>"; };
 		1C8E2A321277852400BC7BD0 /* WebInspectorMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebInspectorMessages.h; sourceTree = "<group>"; };
-		1C8E2DAD1278C5B200BC7BD0 /* WebInspectorMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WebInspectorMac.mm; path = WebInspectorMac.mm; sourceTree = "<group>"; };
+		1C8E2DAD1278C5B200BC7BD0 /* WebInspectorMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebInspectorMac.mm; sourceTree = "<group>"; };
 		1CA8B935127C774E00576C2B /* WebInspectorProxyMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebInspectorProxyMac.mm; sourceTree = "<group>"; };
 		1CA8B943127C882A00576C2B /* WebInspectorProxyMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebInspectorProxyMessageReceiver.cpp; sourceTree = "<group>"; };
 		1CA8B944127C882A00576C2B /* WebInspectorProxyMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebInspectorProxyMessages.h; sourceTree = "<group>"; };
diff --git a/WebKit2/WebProcess/Downloads/Download.cpp b/WebKit2/WebProcess/Downloads/Download.cpp
index 1210db2..7751be0 100644
--- a/WebKit2/WebProcess/Downloads/Download.cpp
+++ b/WebKit2/WebProcess/Downloads/Download.cpp
@@ -61,8 +61,14 @@ void Download::didStart()
     send(Messages::DownloadProxy::DidStart(m_request));
 }
 
+void Download::didReceiveResponse(const ResourceResponse& response)
+{
+    send(Messages::DownloadProxy::DidReceiveResponse(response));
+}
+
 void Download::didReceiveData(uint64_t length)
 {
+    send(Messages::DownloadProxy::DidReceiveData(length));
 }
 
 void Download::didCreateDestination(const String& path)
diff --git a/WebKit2/WebProcess/Downloads/Download.h b/WebKit2/WebProcess/Downloads/Download.h
index 44afb56..1aec7eb 100644
--- a/WebKit2/WebProcess/Downloads/Download.h
+++ b/WebKit2/WebProcess/Downloads/Download.h
@@ -42,6 +42,10 @@ class WKDownloadAsDelegate;
 #endif
 #endif
 
+namespace WebCore {
+    class ResourceResponse;
+}
+
 namespace WebKit {
 
 class Download : public CoreIPC::MessageSender<Download> {
@@ -58,6 +62,7 @@ public:
     void start();
 
     void didStart();
+    void didReceiveResponse(const WebCore::ResourceResponse&);
     void didReceiveData(uint64_t length);
     void didCreateDestination(const String& path);
     void didFinish();
diff --git a/WebKit2/WebProcess/Downloads/mac/DownloadMac.mm b/WebKit2/WebProcess/Downloads/mac/DownloadMac.mm
index 197a7e1..0992a9d 100644
--- a/WebKit2/WebProcess/Downloads/mac/DownloadMac.mm
+++ b/WebKit2/WebProcess/Downloads/mac/DownloadMac.mm
@@ -25,6 +25,7 @@
 
 #include "Download.h"
 
+#include <WebCore/ResourceResponse.h>
 #include "NotImplemented.h"
 
 @interface WKDownloadAsDelegate : NSObject <NSURLConnectionDelegate> {
@@ -46,6 +47,9 @@ void Download::start()
 
     m_delegate.adoptNS([[WKDownloadAsDelegate alloc] initWithDownload:this]);
     m_nsURLDownload.adoptNS([[NSURLDownload alloc] initWithRequest:m_request.nsURLRequest() delegate:m_delegate.get()]);
+
+    // FIXME: Allow this to be changed by the client.
+    [m_nsURLDownload.get() setDeletesFileUponFailure:NO];
 }
 
 void Download::platformInvalidate()
@@ -116,8 +120,8 @@ void Download::platformInvalidate()
 
 - (void)download:(NSURLDownload *)download didReceiveResponse:(NSURLResponse *)response
 {
-    // FIXME: Implement.
-    notImplemented();
+    if (_download)
+        _download->didReceiveResponse(response);
 }
 
 - (void)download:(NSURLDownload *)download willResumeWithResponse:(NSURLResponse *)response fromByte:(long long)startingByte

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list