Commit 9cff7508 authored by andersca@apple.com's avatar andersca@apple.com

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
parent 457f1a25
2010-11-08 Anders Carlsson <andersca@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@apple.com>
Reviewed by Anders Carlsson.
......
......@@ -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;
......
......@@ -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)
......
......@@ -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));
......
......@@ -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);
......
/*
* 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);
}
/*
* 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
......@@ -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
......
......@@ -59,7 +59,7 @@ private:
virtual Type type() const { return APIType; }
// Message handlers.
void didBegin();
void didStart();
void didCreateDestination(const String& path);
void didFinish();
......
......@@ -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()
}
......@@ -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();
......
......@@ -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)
......
/*
* 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
/*
* 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
......@@ -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 \
......
......@@ -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;
};
......
......@@ -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)
......
......@@ -57,7 +57,7 @@ public:
void start();
void didBegin();
void didStart();
void didReceiveData(uint64_t length);
void didCreateDestination(const String& path);
void didFinish();
......
......@@ -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
......
......@@ -1724,6 +1724,14 @@
RelativePath="..\UIProcess\WebContextUserMessageCoders.h"
>
</File>
<File
RelativePath="..\UIProcess\WebDownloadClient.cpp"
>
</File>
<File
RelativePath="..\UIProcess\WebDownloadClient.h"
>
</File>
<File
RelativePath="..\UIProcess\WebEditCommandProxy.cpp"
>
......@@ -1926,6 +1934,14 @@
RelativePath="..\UIProcess\API\C\win\WKContextWin.cpp"
>
</File>
<File
RelativePath="..\UIProcess\API\C\WKDownload.cpp"
>
</File>
<File
RelativePath="..\UIProcess\API\C\WKDownload.h"
>
</File>
<File
RelativePath="..\UIProcess\API\C\WKFormSubmissionListener.cpp"
>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment