[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:36:08 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 9cff75089443399760a874ea21aaa013317f4b73
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Nov 9 01:54:16 2010 +0000

    Add WKDownloadClient API
    https://bugs.webkit.org/show_bug.cgi?id=49227
    
    Reviewed by Dan Bernstein.
    
    * Shared/API/c/WKBase.h:
    Add WKDownloadRef.
    
    * UIProcess/API/C/WKAPICast.h:
    Add WKDownloadRef <-> DownloadProxy mapping.
    
    * UIProcess/API/C/WKContext.cpp:
    (WKContextSetDownloadClient):
    Initialize the download client.
    
    * UIProcess/API/C/WKContext.h:
    Add new WKContextDownloadClient API.
    
    * UIProcess/API/C/WKDownload.cpp: Added.
    * UIProcess/API/C/WKDownload.h:
    Add WKDownload files.
    
    * UIProcess/Downloads/DownloadProxy.cpp:
    (WebKit::DownloadProxy::didStart):
    (WebKit::DownloadProxy::didCreateDestination):
    (WebKit::DownloadProxy::didFinish):
    Call down to the the WebDownloadClient.
    
    * UIProcess/Downloads/DownloadProxy.messages.in:
    Rename DidBegin to DidStart.
    
    * UIProcess/WebContext.cpp:
    (WebKit::WebContext::initializeDownloadClient):
    Initialize the download client.
    
    * UIProcess/WebContext.h:
    (WebKit::WebContext::downloadClient):
    Add getter.
    
    * UIProcess/WebDownloadClient.cpp:
    (WebKit::WebDownloadClient::didStart):
    (WebKit::WebDownloadClient::didCreateDestination):
    (WebKit::WebDownloadClient::didFinish):
    Call the relevant WKContextDownloadClient functions.
    
    * WebKit2.pro:
    * WebKit2.xcodeproj/project.pbxproj:
    Add new files.
    
    * WebProcess/Downloads/Download.cpp:
    (WebKit::Download::didStart):
    * WebProcess/Downloads/Download.h:
    * WebProcess/Downloads/mac/DownloadMac.mm:
    (-[WKDownloadAsDelegate downloadDidBegin:]):
    Rename Download::didBegin to Download::didStart.
    
    * win/WebKit2.vcproj:
    Add new files.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71591 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 40515f9..9d8311f 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,64 @@
+2010-11-08  Anders Carlsson  <andersca at apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        Add WKDownloadClient API
+        https://bugs.webkit.org/show_bug.cgi?id=49227
+
+        * Shared/API/c/WKBase.h:
+        Add WKDownloadRef.
+
+        * UIProcess/API/C/WKAPICast.h:
+        Add WKDownloadRef <-> DownloadProxy mapping.
+        
+        * UIProcess/API/C/WKContext.cpp:
+        (WKContextSetDownloadClient):
+        Initialize the download client.
+
+        * UIProcess/API/C/WKContext.h:
+        Add new WKContextDownloadClient API.
+        
+        * UIProcess/API/C/WKDownload.cpp: Added.
+        * UIProcess/API/C/WKDownload.h:
+        Add WKDownload files.
+
+        * UIProcess/Downloads/DownloadProxy.cpp:
+        (WebKit::DownloadProxy::didStart):
+        (WebKit::DownloadProxy::didCreateDestination):
+        (WebKit::DownloadProxy::didFinish):
+        Call down to the the WebDownloadClient.
+        
+        * UIProcess/Downloads/DownloadProxy.messages.in:
+        Rename DidBegin to DidStart.
+
+        * UIProcess/WebContext.cpp:
+        (WebKit::WebContext::initializeDownloadClient):
+        Initialize the download client.
+
+        * UIProcess/WebContext.h:
+        (WebKit::WebContext::downloadClient):
+        Add getter.
+
+        * UIProcess/WebDownloadClient.cpp:
+        (WebKit::WebDownloadClient::didStart):
+        (WebKit::WebDownloadClient::didCreateDestination):
+        (WebKit::WebDownloadClient::didFinish):
+        Call the relevant WKContextDownloadClient functions.
+
+        * WebKit2.pro:
+        * WebKit2.xcodeproj/project.pbxproj:
+        Add new files.
+
+        * WebProcess/Downloads/Download.cpp:
+        (WebKit::Download::didStart):
+        * WebProcess/Downloads/Download.h:
+        * WebProcess/Downloads/mac/DownloadMac.mm:
+        (-[WKDownloadAsDelegate downloadDidBegin:]):
+        Rename Download::didBegin to Download::didStart.
+
+        * win/WebKit2.vcproj:
+        Add new files.
+
 2010-11-08  Brady Eidson  <beidson at apple.com>
 
         Reviewed by Anders Carlsson.
diff --git a/WebKit2/Shared/API/c/WKBase.h b/WebKit2/Shared/API/c/WKBase.h
index 03772d3..21229b4 100644
--- a/WebKit2/Shared/API/c/WKBase.h
+++ b/WebKit2/Shared/API/c/WKBase.h
@@ -61,6 +61,7 @@ typedef const struct OpaqueWKUserContentURLPattern* WKUserContentURLPatternRef;
 typedef const struct OpaqueWKBackForwardList* WKBackForwardListRef;
 typedef const struct OpaqueWKBackForwardListItem* WKBackForwardListItemRef;
 typedef const struct OpaqueWKContext* WKContextRef;
+typedef const struct OpaqueWKDownload* WKDownloadRef;
 typedef const struct OpaqueWKFormSubmissionListener* WKFormSubmissionListenerRef;
 typedef const struct OpaqueWKFrame* WKFrameRef;
 typedef const struct OpaqueWKFramePolicyListener* WKFramePolicyListenerRef;
diff --git a/WebKit2/UIProcess/API/C/WKAPICast.h b/WebKit2/UIProcess/API/C/WKAPICast.h
index 2553485..71f8537 100644
--- a/WebKit2/UIProcess/API/C/WKAPICast.h
+++ b/WebKit2/UIProcess/API/C/WKAPICast.h
@@ -35,6 +35,7 @@
 
 namespace WebKit {
 
+class DownloadProxy;
 class WebBackForwardList;
 class WebBackForwardListItem;
 class WebContext;
@@ -50,6 +51,7 @@ class WebPreferences;
 WK_ADD_API_MAPPING(WKBackForwardListItemRef, WebBackForwardListItem)
 WK_ADD_API_MAPPING(WKBackForwardListRef, WebBackForwardList)
 WK_ADD_API_MAPPING(WKContextRef, WebContext)
+WK_ADD_API_MAPPING(WKDownloadRef, DownloadProxy)
 WK_ADD_API_MAPPING(WKFormSubmissionListenerRef, WebFormSubmissionListenerProxy)
 WK_ADD_API_MAPPING(WKFramePolicyListenerRef, WebFramePolicyListenerProxy)
 WK_ADD_API_MAPPING(WKFrameRef, WebFrameProxy)
diff --git a/WebKit2/UIProcess/API/C/WKContext.cpp b/WebKit2/UIProcess/API/C/WKContext.cpp
index 7f3a098..48f8011 100644
--- a/WebKit2/UIProcess/API/C/WKContext.cpp
+++ b/WebKit2/UIProcess/API/C/WKContext.cpp
@@ -86,6 +86,13 @@ void WKContextSetHistoryClient(WKContextRef contextRef, const WKContextHistoryCl
     toImpl(contextRef)->initializeHistoryClient(wkClient);
 }
 
+void WKContextSetDownloadClient(WKContextRef contextRef, const WKContextDownloadClient* wkClient)
+{
+    if (wkClient && wkClient->version)
+        return;
+    toImpl(contextRef)->initializeDownloadClient(wkClient);
+}
+
 void WKContextSetInitializationUserDataForInjectedBundle(WKContextRef contextRef,  WKTypeRef userDataRef)
 {
     toImpl(contextRef)->setInjectedBundleInitializationUserData(toImpl(userDataRef));
diff --git a/WebKit2/UIProcess/API/C/WKContext.h b/WebKit2/UIProcess/API/C/WKContext.h
index 71d3859..d8800dd 100644
--- a/WebKit2/UIProcess/API/C/WKContext.h
+++ b/WebKit2/UIProcess/API/C/WKContext.h
@@ -69,6 +69,20 @@ struct WKContextHistoryClient {
 };
 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 (*WKContextDownloadDidCreateDestinationCallback)(WKContextRef context, WKDownloadRef download, WKStringRef path, const void *clientInfo);
+
+struct WKContextDownloadClient {
+    int                                                                 version;
+    const void *                                                        clientInfo;
+    WKContextDownloadDidStartCallback                                   didStart;
+    WKContextDownloadDidCreateDestinationCallback                       didCreateDestination;
+    WKContextDownloadDidFinishCallback                                  didFinish;
+};
+typedef struct WKContextDownloadClient WKContextDownloadClient;
+
 WK_EXPORT WKTypeID WKContextGetTypeID();
 
 WK_EXPORT WKContextRef WKContextCreate();
@@ -78,8 +92,9 @@ WK_EXPORT WKContextRef WKContextGetSharedProcessContext();
 WK_EXPORT void WKContextSetPreferences(WKContextRef context, WKPreferencesRef preferences);
 WK_EXPORT WKPreferencesRef WKContextGetPreferences(WKContextRef context);
 
-WK_EXPORT void WKContextSetHistoryClient(WKContextRef context, const WKContextHistoryClient* client);
 WK_EXPORT void WKContextSetInjectedBundleClient(WKContextRef context, const WKContextInjectedBundleClient* client);
+WK_EXPORT void WKContextSetHistoryClient(WKContextRef context, const WKContextHistoryClient* client);
+WK_EXPORT void WKContextSetDownloadClient(WKContextRef context, const WKContextDownloadClient* client);
 
 WK_EXPORT void WKContextSetInitializationUserDataForInjectedBundle(WKContextRef context, WKTypeRef userData);
 WK_EXPORT void WKContextPostMessageToInjectedBundle(WKContextRef context, WKStringRef messageName, WKTypeRef messageBody);
diff --git a/WebKit2/UIProcess/API/C/WKDownload.cpp b/WebKit2/UIProcess/API/C/WKDownload.cpp
new file mode 100644
index 0000000..3703c72
--- /dev/null
+++ b/WebKit2/UIProcess/API/C/WKDownload.cpp
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "WKDownload.h"
+
+#include "DownloadProxy.h"
+#include "WKAPICast.h"
+
+using namespace WebKit;
+
+WKTypeID WKDownloadGetTypeID()
+{
+    return toAPI(DownloadProxy::APIType);
+}
+
diff --git a/WebKit2/UIProcess/API/C/WKDownload.h b/WebKit2/UIProcess/API/C/WKDownload.h
new file mode 100644
index 0000000..9e5d2c0
--- /dev/null
+++ b/WebKit2/UIProcess/API/C/WKDownload.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WKDownload_h
+#define WKDownload_h
+
+#include <WebKit2/WKBase.h>
+
+#ifndef __cplusplus
+#include <stdbool.h>
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+WK_EXPORT WKTypeID WKDownloadGetTypeID();
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // WKDownload_h
diff --git a/WebKit2/UIProcess/Downloads/DownloadProxy.cpp b/WebKit2/UIProcess/Downloads/DownloadProxy.cpp
index 2a96422..47c7491 100644
--- a/WebKit2/UIProcess/Downloads/DownloadProxy.cpp
+++ b/WebKit2/UIProcess/Downloads/DownloadProxy.cpp
@@ -26,8 +26,9 @@
 #include "DownloadProxy.h"
 
 #include "NotImplemented.h"
-#include <wtf/text/WTFString.h>
+#include "WebContext.h"
 #include <wtf/text/CString.h>
+#include <wtf/text/WTFString.h>
 
 namespace WebKit {
 
@@ -58,12 +59,12 @@ void DownloadProxy::invalidate()
     m_webContext = 0;
 }
 
-void DownloadProxy::didBegin()
+void DownloadProxy::didStart()
 {
     if (!m_webContext)
         return;
 
-    notImplemented();
+    m_webContext->downloadClient().didStart(m_webContext, this);
 }
 
 void DownloadProxy::didCreateDestination(const String& path)
@@ -71,8 +72,7 @@ void DownloadProxy::didCreateDestination(const String& path)
     if (!m_webContext)
         return;
 
-    printf("path: %s\n", path.ascii().data());
-    notImplemented();
+    m_webContext->downloadClient().didCreateDestination(m_webContext, this, path);
 }
 
 void DownloadProxy::didFinish()
@@ -80,7 +80,7 @@ void DownloadProxy::didFinish()
     if (!m_webContext)
         return;
 
-    notImplemented();
+    m_webContext->downloadClient().didFinish(m_webContext, this);
 }
 
 } // namespace WebKit
diff --git a/WebKit2/UIProcess/Downloads/DownloadProxy.h b/WebKit2/UIProcess/Downloads/DownloadProxy.h
index f5e95c6..1f63e79 100644
--- a/WebKit2/UIProcess/Downloads/DownloadProxy.h
+++ b/WebKit2/UIProcess/Downloads/DownloadProxy.h
@@ -59,7 +59,7 @@ private:
     virtual Type type() const { return APIType; }
 
     // Message handlers.
-    void didBegin();
+    void didStart();
     void didCreateDestination(const String& path);
     void didFinish();
 
diff --git a/WebKit2/UIProcess/Downloads/DownloadProxy.messages.in b/WebKit2/UIProcess/Downloads/DownloadProxy.messages.in
index c9ad439..b6f55e5 100644
--- a/WebKit2/UIProcess/Downloads/DownloadProxy.messages.in
+++ b/WebKit2/UIProcess/Downloads/DownloadProxy.messages.in
@@ -21,7 +21,7 @@
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 messages -> DownloadProxy {
-    DidBegin()
+    DidStart()
     DidCreateDestination(WTF::String path)
     DidFinish()
 }
diff --git a/WebKit2/UIProcess/WebContext.cpp b/WebKit2/UIProcess/WebContext.cpp
index bd7bc82..0d100c0 100644
--- a/WebKit2/UIProcess/WebContext.cpp
+++ b/WebKit2/UIProcess/WebContext.cpp
@@ -129,6 +129,11 @@ void WebContext::initializeHistoryClient(const WKContextHistoryClient* client)
     m_process->send(Messages::WebProcess::SetShouldTrackVisitedLinks(m_historyClient.shouldTrackVisitedLinks()), 0);
 }
 
+void WebContext::initializeDownloadClient(const WKContextDownloadClient* client)
+{
+    m_downloadClient.initialize(client);
+}
+    
 void WebContext::languageChanged(void* context)
 {
     static_cast<WebContext*>(context)->languageChanged();
diff --git a/WebKit2/UIProcess/WebContext.h b/WebKit2/UIProcess/WebContext.h
index 3a98266..65c19d0 100644
--- a/WebKit2/UIProcess/WebContext.h
+++ b/WebKit2/UIProcess/WebContext.h
@@ -31,6 +31,7 @@
 #include "ProcessModel.h"
 #include "VisitedLinkProvider.h"
 #include "WebContextInjectedBundleClient.h"
+#include "WebDownloadClient.h"
 #include "WebHistoryClient.h"
 #include "WebProcessProxy.h"
 #include <WebCore/LinkHash.h>
@@ -63,6 +64,7 @@ public:
 
     void initializeInjectedBundleClient(const WKContextInjectedBundleClient*);
     void initializeHistoryClient(const WKContextHistoryClient*);
+    void initializeDownloadClient(const WKContextDownloadClient*);
 
     ProcessModel processModel() const { return m_processModel; }
     WebProcessProxy* process() const { return m_process.get(); }
@@ -124,6 +126,7 @@ public:
 
     // Downloads.
     uint64_t createDownloadProxy();
+    WebDownloadClient& downloadClient() { return m_downloadClient; }
 
 private:
     WebContext(ProcessModel, const String& injectedBundlePath);
@@ -162,6 +165,7 @@ private:
 
     CacheModel m_cacheModel;
 
+    WebDownloadClient m_downloadClient;
     HashMap<uint64_t, RefPtr<DownloadProxy> > m_downloads;
 
 #if PLATFORM(WIN)
diff --git a/WebKit2/UIProcess/WebDownloadClient.cpp b/WebKit2/UIProcess/WebDownloadClient.cpp
new file mode 100644
index 0000000..7ab41d9
--- /dev/null
+++ b/WebKit2/UIProcess/WebDownloadClient.cpp
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "WebDownloadClient.h"
+
+#include "WKAPICast.h"
+
+namespace WebKit {
+
+void WebDownloadClient::didStart(WebContext* webContext, DownloadProxy* downloadProxy)
+{
+    if (!m_client.didStart)
+        return;
+
+    m_client.didStart(toAPI(webContext), toAPI(downloadProxy), m_client.clientInfo);
+}
+
+void WebDownloadClient::didCreateDestination(WebContext* webContext, DownloadProxy* downloadProxy, const String& path)
+{
+    if (!m_client.didCreateDestination)
+        return;
+
+    m_client.didCreateDestination(toAPI(webContext), toAPI(downloadProxy), toAPI(path.impl()), m_client.clientInfo);
+}
+
+void WebDownloadClient::didFinish(WebContext* webContext, DownloadProxy* downloadProxy)
+{
+    if (!m_client.didFinish)
+        return;
+    
+    m_client.didFinish(toAPI(webContext), toAPI(downloadProxy), m_client.clientInfo);
+}    
+
+} // namespace WebKit
diff --git a/WebKit2/UIProcess/WebDownloadClient.h b/WebKit2/UIProcess/WebDownloadClient.h
new file mode 100644
index 0000000..ba01861
--- /dev/null
+++ b/WebKit2/UIProcess/WebDownloadClient.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebDownloadClient_h
+#define WebDownloadClient_h
+
+#include "APIClient.h"
+#include "WKContext.h"
+#include <wtf/Forward.h>
+
+namespace WebKit {
+
+class DownloadProxy;
+class WebContext;
+
+class WebDownloadClient : public APIClient<WKContextDownloadClient> {
+public:
+    void didStart(WebContext*, DownloadProxy*);
+    void didCreateDestination(WebContext*, DownloadProxy*, const String& path);
+    void didFinish(WebContext*, DownloadProxy*);
+};
+
+} // namespace WebKit
+
+#endif // WebDownloadClient_h
diff --git a/WebKit2/WebKit2.pro b/WebKit2/WebKit2.pro
index 6d65ca6..06e0c1c 100644
--- a/WebKit2/WebKit2.pro
+++ b/WebKit2/WebKit2.pro
@@ -246,6 +246,7 @@ HEADERS += \
     UIProcess/API/C/WKBackForwardListItem.h \
     UIProcess/API/C/WKContext.h \
     UIProcess/API/C/WKContextPrivate.h \
+    UIProcess/API/C/WKDownload.h \
     UIProcess/API/C/WKFrame.h \
     UIProcess/API/C/WKFramePolicyListener.h \
     UIProcess/API/C/WKInspector.h \
@@ -282,6 +283,7 @@ HEADERS += \
     UIProcess/WebContextInjectedBundleClient.h \
     UIProcess/WebContextMenuProxy.h \
     UIProcess/WebContextUserMessageCoders.h \
+    UIProcess/WebDownloadClient.h \
     UIProcess/WebEditCommandProxy.h \
     UIProcess/WebFindClient.h \
     UIProcess/WebFormClient.h \
@@ -415,6 +417,7 @@ SOURCES += \
     UIProcess/API/C/WKBackForwardList.cpp \
     UIProcess/API/C/WKBackForwardListItem.cpp \
     UIProcess/API/C/WKContext.cpp \
+    UIProcess/API/C/WKDownload.cpp \
     UIProcess/API/C/WKFrame.cpp \
     UIProcess/API/C/WKFramePolicyListener.cpp \
     UIProcess/API/C/WKInspector.cpp \
@@ -447,6 +450,7 @@ SOURCES += \
     UIProcess/WebContext.cpp \
     UIProcess/WebContextMenuProxy.cpp \
     UIProcess/WebContextInjectedBundleClient.cpp \
+    UIProcess/WebDownloadClient.cpp \
     UIProcess/WebEditCommandProxy.cpp \
     UIProcess/WebFindClient.cpp \
     UIProcess/WebFormClient.cpp \
diff --git a/WebKit2/WebKit2.xcodeproj/project.pbxproj b/WebKit2/WebKit2.xcodeproj/project.pbxproj
index 6ba2121..d5307e0 100644
--- a/WebKit2/WebKit2.xcodeproj/project.pbxproj
+++ b/WebKit2/WebKit2.xcodeproj/project.pbxproj
@@ -161,6 +161,10 @@
 		1AB7D4CB1288AAA700CFD08C /* DownloadProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AB7D4C91288AAA700CFD08C /* DownloadProxy.cpp */; };
 		1AB7D6191288B9D900CFD08C /* DownloadProxyMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AB7D6171288B9D900CFD08C /* DownloadProxyMessageReceiver.cpp */; };
 		1AB7D61A1288B9D900CFD08C /* DownloadProxyMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AB7D6181288B9D900CFD08C /* DownloadProxyMessages.h */; };
+		1AB7D72C1288CAAD00CFD08C /* WebDownloadClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AB7D72A1288CAAD00CFD08C /* WebDownloadClient.h */; };
+		1AB7D72D1288CAAD00CFD08C /* WebDownloadClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AB7D72B1288CAAD00CFD08C /* WebDownloadClient.cpp */; };
+		1AB7D78D1288CD9A00CFD08C /* WKDownload.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AB7D78B1288CD9A00CFD08C /* WKDownload.h */; };
+		1AB7D78E1288CD9A00CFD08C /* WKDownload.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AB7D78C1288CD9A00CFD08C /* WKDownload.cpp */; };
 		1AC41AC71263C88300054E94 /* BinarySemaphore.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AC41AC51263C88300054E94 /* BinarySemaphore.h */; };
 		1AC41AC81263C88300054E94 /* BinarySemaphore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC41AC61263C88300054E94 /* BinarySemaphore.cpp */; };
 		1AE117F611DBB30900981615 /* ProcessLauncher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AE117F511DBB30900981615 /* ProcessLauncher.cpp */; };
@@ -697,6 +701,10 @@
 		1AB7D5E91288B8C000CFD08C /* DownloadProxy.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DownloadProxy.messages.in; sourceTree = "<group>"; };
 		1AB7D6171288B9D900CFD08C /* DownloadProxyMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DownloadProxyMessageReceiver.cpp; sourceTree = "<group>"; };
 		1AB7D6181288B9D900CFD08C /* DownloadProxyMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DownloadProxyMessages.h; sourceTree = "<group>"; };
+		1AB7D72A1288CAAD00CFD08C /* WebDownloadClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebDownloadClient.h; sourceTree = "<group>"; };
+		1AB7D72B1288CAAD00CFD08C /* WebDownloadClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebDownloadClient.cpp; sourceTree = "<group>"; };
+		1AB7D78B1288CD9A00CFD08C /* WKDownload.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKDownload.h; sourceTree = "<group>"; };
+		1AB7D78C1288CD9A00CFD08C /* WKDownload.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKDownload.cpp; sourceTree = "<group>"; };
 		1AC41AC51263C88300054E94 /* BinarySemaphore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BinarySemaphore.h; sourceTree = "<group>"; };
 		1AC41AC61263C88300054E94 /* BinarySemaphore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BinarySemaphore.cpp; sourceTree = "<group>"; };
 		1AE117F511DBB30900981615 /* ProcessLauncher.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ProcessLauncher.cpp; sourceTree = "<group>"; };
@@ -1608,6 +1616,8 @@
 				BCDE059A11CDA8AE00E41AF1 /* WebContextInjectedBundleClient.cpp */,
 				BCDE059911CDA8AE00E41AF1 /* WebContextInjectedBundleClient.h */,
 				BCB0B0DB12305A2500B1341E /* WebContextUserMessageCoders.h */,
+				1AB7D72B1288CAAD00CFD08C /* WebDownloadClient.cpp */,
+				1AB7D72A1288CAAD00CFD08C /* WebDownloadClient.h */,
 				BCA0EF9E12332642007D3CFB /* WebEditCommandProxy.cpp */,
 				BCA0EF9D12332642007D3CFB /* WebEditCommandProxy.h */,
 				1A3DD1FC125E59F3004515E6 /* WebFindClient.cpp */,
@@ -1675,6 +1685,8 @@
 				BCB9E24A1120E15C00A137E0 /* WKContext.cpp */,
 				BCB9E2491120E15C00A137E0 /* WKContext.h */,
 				BCC938E01180DE440085E5FE /* WKContextPrivate.h */,
+				1AB7D78C1288CD9A00CFD08C /* WKDownload.cpp */,
+				1AB7D78B1288CD9A00CFD08C /* WKDownload.h */,
 				BCE469571214EDF4000B98EB /* WKFormSubmissionListener.cpp */,
 				BCE469581214EDF4000B98EB /* WKFormSubmissionListener.h */,
 				BCD01398110FA420003B8A67 /* WKFrame.cpp */,
@@ -2336,6 +2348,8 @@
 				510FBB9B1288C95E00AFFDF4 /* WebContextMenuItemData.h in Headers */,
 				1AB7D4CA1288AAA700CFD08C /* DownloadProxy.h in Headers */,
 				1AB7D61A1288B9D900CFD08C /* DownloadProxyMessages.h in Headers */,
+				1AB7D72C1288CAAD00CFD08C /* WebDownloadClient.h in Headers */,
+				1AB7D78D1288CD9A00CFD08C /* WKDownload.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -2682,6 +2696,8 @@
 				510FBB9A1288C95E00AFFDF4 /* WebContextMenuItemData.cpp in Sources */,
 				1AB7D4CB1288AAA700CFD08C /* DownloadProxy.cpp in Sources */,
 				1AB7D6191288B9D900CFD08C /* DownloadProxyMessageReceiver.cpp in Sources */,
+				1AB7D72D1288CAAD00CFD08C /* WebDownloadClient.cpp in Sources */,
+				1AB7D78E1288CD9A00CFD08C /* WKDownload.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
diff --git a/WebKit2/WebProcess/Downloads/Download.cpp b/WebKit2/WebProcess/Downloads/Download.cpp
index 11f3638..63e403a 100644
--- a/WebKit2/WebProcess/Downloads/Download.cpp
+++ b/WebKit2/WebProcess/Downloads/Download.cpp
@@ -55,9 +55,9 @@ CoreIPC::Connection* Download::connection() const
     return WebProcess::shared().connection();
 }
 
-void Download::didBegin()
+void Download::didStart()
 {
-    send(Messages::DownloadProxy::DidBegin());
+    send(Messages::DownloadProxy::DidStart());
 }
 
 void Download::didReceiveData(uint64_t length)
diff --git a/WebKit2/WebProcess/Downloads/Download.h b/WebKit2/WebProcess/Downloads/Download.h
index 6aa3c74..995b896 100644
--- a/WebKit2/WebProcess/Downloads/Download.h
+++ b/WebKit2/WebProcess/Downloads/Download.h
@@ -57,7 +57,7 @@ public:
 
     void start();
 
-    void didBegin();
+    void didStart();
     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 2f571c8..197a7e1 100644
--- a/WebKit2/WebProcess/Downloads/mac/DownloadMac.mm
+++ b/WebKit2/WebProcess/Downloads/mac/DownloadMac.mm
@@ -80,7 +80,7 @@ void Download::platformInvalidate()
 - (void)downloadDidBegin:(NSURLDownload *)download
 {
     if (_download)
-        _download->didBegin();
+        _download->didStart();
 }
 
 - (NSURLRequest *)download:(NSURLDownload *)download willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)redirectResponse
diff --git a/WebKit2/win/WebKit2.vcproj b/WebKit2/win/WebKit2.vcproj
index 22ba65e..50ff5f5 100755
--- a/WebKit2/win/WebKit2.vcproj
+++ b/WebKit2/win/WebKit2.vcproj
@@ -1725,6 +1725,14 @@
 				>
 			</File>
 			<File
+				RelativePath="..\UIProcess\WebDownloadClient.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\UIProcess\WebDownloadClient.h"
+				>
+			</File>
+			<File
 				RelativePath="..\UIProcess\WebEditCommandProxy.cpp"
 				>
 			</File>
@@ -1927,6 +1935,14 @@
 						>
 					</File>
 					<File
+						RelativePath="..\UIProcess\API\C\WKDownload.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\UIProcess\API\C\WKDownload.h"
+						>
+					</File>
+					<File
 						RelativePath="..\UIProcess\API\C\WKFormSubmissionListener.cpp"
 						>
 					</File>

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list