summaryrefslogtreecommitdiff
path: root/Source/WebKit2/WebProcess/Downloads
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit2/WebProcess/Downloads')
-rw-r--r--Source/WebKit2/WebProcess/Downloads/Download.h11
-rwxr-xr-xSource/WebKit2/WebProcess/Downloads/efl/DownloadEfl.cpp4
-rw-r--r--Source/WebKit2/WebProcess/Downloads/efl/FileDownloaderEfl.cpp89
-rw-r--r--Source/WebKit2/WebProcess/Downloads/efl/FileDownloaderEfl.h69
4 files changed, 172 insertions, 1 deletions
diff --git a/Source/WebKit2/WebProcess/Downloads/Download.h b/Source/WebKit2/WebProcess/Downloads/Download.h
index 0387efa66..2688b72d1 100644
--- a/Source/WebKit2/WebProcess/Downloads/Download.h
+++ b/Source/WebKit2/WebProcess/Downloads/Download.h
@@ -47,6 +47,10 @@ OBJC_CLASS WKDownloadAsDelegate;
#include <CFNetwork/CFURLDownloadPriv.h>
#endif
+#if PLATFORM(EFL)
+#include <FileDownloaderEfl.h>
+#endif
+
namespace CoreIPC {
class DataReference;
}
@@ -69,6 +73,10 @@ class WebPage;
class QtFileDownloader;
#endif
+#if PLATFORM(EFL)
+class FileDownloaderEfl;
+#endif
+
class Download : public CoreIPC::MessageSender<Download> {
WTF_MAKE_NONCOPYABLE(Download);
public:
@@ -146,6 +154,9 @@ private:
OwnPtr<WebCore::ResourceHandleClient> m_downloadClient;
RefPtr<WebCore::ResourceHandle> m_resourceHandle;
#endif
+#if PLATFORM(EFL)
+ OwnPtr<FileDownloaderEfl> m_fileDownloader;
+#endif
};
} // namespace WebKit
diff --git a/Source/WebKit2/WebProcess/Downloads/efl/DownloadEfl.cpp b/Source/WebKit2/WebProcess/Downloads/efl/DownloadEfl.cpp
index 7d098f133..9828c2b0c 100755
--- a/Source/WebKit2/WebProcess/Downloads/efl/DownloadEfl.cpp
+++ b/Source/WebKit2/WebProcess/Downloads/efl/DownloadEfl.cpp
@@ -20,6 +20,7 @@
#include "config.h"
#include "Download.h"
+#include "FileDownloaderEfl.h"
#include <WebCore/NotImplemented.h>
using namespace WebCore;
@@ -28,7 +29,8 @@ namespace WebKit {
void Download::start(WebPage* initiatingWebPage)
{
- notImplemented();
+ m_fileDownloader = FileDownloaderEfl::create(this);
+ m_fileDownloader->start(initiatingWebPage, m_request);
}
void Download::startWithHandle(WebPage* initiatingPage, ResourceHandle* handle, const ResourceResponse& response)
diff --git a/Source/WebKit2/WebProcess/Downloads/efl/FileDownloaderEfl.cpp b/Source/WebKit2/WebProcess/Downloads/efl/FileDownloaderEfl.cpp
new file mode 100644
index 000000000..8f17840e1
--- /dev/null
+++ b/Source/WebKit2/WebProcess/Downloads/efl/FileDownloaderEfl.cpp
@@ -0,0 +1,89 @@
+/*
+ * Copyright (C) 2012 Samsung Electronics
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "FileDownloaderEfl.h"
+
+#include <WebCore/NotImplemented.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+PassOwnPtr<FileDownloaderEfl> FileDownloaderEfl::create(Download* download)
+{
+ return adoptPtr(new FileDownloaderEfl(download));
+}
+
+FileDownloaderEfl::FileDownloaderEfl(Download* download)
+ : m_download(download)
+{
+ ASSERT(download);
+}
+
+FileDownloaderEfl::~FileDownloaderEfl()
+{
+}
+
+void FileDownloaderEfl::start(WebPage*, ResourceRequest&)
+{
+ notImplemented();
+}
+
+void FileDownloaderEfl::didReceiveResponse(ResourceHandle*, const ResourceResponse&)
+{
+ notImplemented();
+}
+
+void FileDownloaderEfl::didReceiveData(ResourceHandle*, const char*, int, int)
+{
+ notImplemented();
+}
+
+void FileDownloaderEfl::didFinishLoading(ResourceHandle*, double)
+{
+ notImplemented();
+}
+
+void FileDownloaderEfl::didFail(ResourceHandle*, const ResourceError&)
+{
+ notImplemented();
+}
+
+bool FileDownloaderEfl::shouldUseCredentialStorage(ResourceHandle*)
+{
+ return false;
+}
+
+void FileDownloaderEfl::didReceiveAuthenticationChallenge(ResourceHandle*, const AuthenticationChallenge&)
+{
+ notImplemented();
+}
+
+void FileDownloaderEfl::didCancelAuthenticationChallenge(ResourceHandle*, const AuthenticationChallenge&)
+{
+ notImplemented();
+}
+
+void FileDownloaderEfl::receivedCancellation(ResourceHandle*, const AuthenticationChallenge&)
+{
+ notImplemented();
+}
+
+} // namespace WebKit
diff --git a/Source/WebKit2/WebProcess/Downloads/efl/FileDownloaderEfl.h b/Source/WebKit2/WebProcess/Downloads/efl/FileDownloaderEfl.h
new file mode 100644
index 000000000..d8f998be9
--- /dev/null
+++ b/Source/WebKit2/WebProcess/Downloads/efl/FileDownloaderEfl.h
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2012 Samsung Electronics
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef FileDownloaderEfl_h
+#define FileDownloaderEfl_h
+
+#include <WebCore/ResourceError.h>
+#include <WebCore/ResourceHandle.h>
+#include <WebCore/ResourceHandleClient.h>
+#include <WebCore/ResourceRequest.h>
+#include <WebCore/ResourceResponse.h>
+#include <wtf/PassOwnPtr.h>
+
+namespace WebCore {
+class AuthenticationChallenge;
+class ResourceError;
+class ResourceHandle;
+class ResourceHandleClient;
+class ResourceRequest;
+class ResourceResponse;
+}
+
+namespace WebKit {
+
+class Download;
+class WebPage;
+
+class FileDownloaderEfl : public WebCore::ResourceHandleClient {
+public:
+ static PassOwnPtr<FileDownloaderEfl> create(Download*);
+ virtual ~FileDownloaderEfl();
+
+ void start(WebPage*, WebCore::ResourceRequest&);
+
+ // callbacks for ResourceHandleClient, which are called by ResourceHandle
+ virtual void didReceiveResponse(WebCore::ResourceHandle*, const WebCore::ResourceResponse&) OVERRIDE;
+ virtual void didReceiveData(WebCore::ResourceHandle*, const char* data, int length, int encodedDataLength) OVERRIDE;
+ virtual void didFinishLoading(WebCore::ResourceHandle*, double finishTime) OVERRIDE;
+ virtual void didFail(WebCore::ResourceHandle*, const WebCore::ResourceError&) OVERRIDE;
+ virtual bool shouldUseCredentialStorage(WebCore::ResourceHandle*) OVERRIDE;
+ virtual void didReceiveAuthenticationChallenge(WebCore::ResourceHandle*, const WebCore::AuthenticationChallenge&) OVERRIDE;
+ virtual void didCancelAuthenticationChallenge(WebCore::ResourceHandle*, const WebCore::AuthenticationChallenge&) OVERRIDE;
+ virtual void receivedCancellation(WebCore::ResourceHandle*, const WebCore::AuthenticationChallenge&) OVERRIDE;
+
+private:
+ FileDownloaderEfl(Download*);
+
+ Download* m_download;
+};
+
+} // namespace WebKit
+
+#endif // FileDownloaderEfl_h