summaryrefslogtreecommitdiff
path: root/Source/WebKit2/WebProcess
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit2/WebProcess')
-rw-r--r--Source/WebKit2/WebProcess/Downloads/Download.h15
-rwxr-xr-xSource/WebKit2/WebProcess/Downloads/efl/DownloadEfl.cpp91
-rw-r--r--Source/WebKit2/WebProcess/Downloads/efl/DownloadSoupErrorsEfl.cpp45
-rw-r--r--Source/WebKit2/WebProcess/Downloads/efl/FileDownloaderEfl.cpp89
-rw-r--r--Source/WebKit2/WebProcess/Downloads/efl/FileDownloaderEfl.h69
-rw-r--r--Source/WebKit2/WebProcess/Downloads/gtk/DownloadSoupErrorsGtk.cpp45
-rw-r--r--Source/WebKit2/WebProcess/Downloads/soup/DownloadSoup.cpp41
-rw-r--r--Source/WebKit2/WebProcess/Downloads/soup/DownloadSoupErrors.h39
-rw-r--r--Source/WebKit2/WebProcess/WebCoreSupport/WebPopupMenu.cpp7
-rw-r--r--Source/WebKit2/WebProcess/WebCoreSupport/WebPopupMenu.h2
-rw-r--r--Source/WebKit2/WebProcess/WebCoreSupport/WebVibrationClient.cpp2
-rw-r--r--Source/WebKit2/WebProcess/WebCoreSupport/WebVibrationClient.h2
-rw-r--r--Source/WebKit2/WebProcess/WebCoreSupport/efl/WebErrorsEfl.cpp25
-rw-r--r--Source/WebKit2/WebProcess/WebCoreSupport/qt/WebPopupMenuQt.cpp4
-rw-r--r--Source/WebKit2/WebProcess/WebPage/WebPage.cpp16
-rw-r--r--Source/WebKit2/WebProcess/WebPage/WebPage.h5
-rw-r--r--Source/WebKit2/WebProcess/WebPage/WebPage.messages.in6
-rw-r--r--Source/WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp16
-rw-r--r--Source/WebKit2/WebProcess/efl/WebProcessMainEfl.cpp10
-rw-r--r--Source/WebKit2/WebProcess/qt/QtNetworkAccessManager.cpp12
20 files changed, 233 insertions, 308 deletions
diff --git a/Source/WebKit2/WebProcess/Downloads/Download.h b/Source/WebKit2/WebProcess/Downloads/Download.h
index 2688b72d1..d751087a1 100644
--- a/Source/WebKit2/WebProcess/Downloads/Download.h
+++ b/Source/WebKit2/WebProcess/Downloads/Download.h
@@ -38,7 +38,7 @@ OBJC_CLASS NSURLDownload;
OBJC_CLASS WKDownloadAsDelegate;
#endif
-#if PLATFORM(GTK)
+#if PLATFORM(GTK) || PLATFORM(EFL)
#include <WebCore/ResourceHandle.h>
#include <WebCore/ResourceHandleClient.h>
#endif
@@ -47,10 +47,6 @@ OBJC_CLASS WKDownloadAsDelegate;
#include <CFNetwork/CFURLDownloadPriv.h>
#endif
-#if PLATFORM(EFL)
-#include <FileDownloaderEfl.h>
-#endif
-
namespace CoreIPC {
class DataReference;
}
@@ -73,10 +69,6 @@ class WebPage;
class QtFileDownloader;
#endif
-#if PLATFORM(EFL)
-class FileDownloaderEfl;
-#endif
-
class Download : public CoreIPC::MessageSender<Download> {
WTF_MAKE_NONCOPYABLE(Download);
public:
@@ -150,13 +142,10 @@ private:
#if PLATFORM(QT)
QtFileDownloader* m_qtDownloader;
#endif
-#if PLATFORM(GTK)
+#if PLATFORM(GTK) || PLATFORM(EFL)
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
deleted file mode 100755
index 9828c2b0c..000000000
--- a/Source/WebKit2/WebProcess/Downloads/efl/DownloadEfl.cpp
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * 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 "Download.h"
-
-#include "FileDownloaderEfl.h"
-#include <WebCore/NotImplemented.h>
-
-using namespace WebCore;
-
-namespace WebKit {
-
-void Download::start(WebPage* initiatingWebPage)
-{
- m_fileDownloader = FileDownloaderEfl::create(this);
- m_fileDownloader->start(initiatingWebPage, m_request);
-}
-
-void Download::startWithHandle(WebPage* initiatingPage, ResourceHandle* handle, const ResourceResponse& response)
-{
- notImplemented();
-}
-
-void Download::cancel()
-{
- notImplemented();
-}
-
-void Download::platformInvalidate()
-{
- notImplemented();
-}
-
-void Download::didDecideDestination(const String& destination, bool allowOverwrite)
-{
- notImplemented();
-}
-
-void Download::platformDidFinish()
-{
- notImplemented();
-}
-
-void Download::receivedCredential(const AuthenticationChallenge& authenticationChallenge, const Credential& credential)
-{
- notImplemented();
-}
-
-void Download::receivedRequestToContinueWithoutCredential(const AuthenticationChallenge& authenticationChallenge)
-{
- notImplemented();
-}
-
-void Download::receivedCancellation(const AuthenticationChallenge& authenticationChallenge)
-{
- notImplemented();
-}
-
-void Download::useCredential(const WebCore::AuthenticationChallenge& authenticationChallenge, const WebCore::Credential& credential)
-{
- notImplemented();
-}
-
-void Download::continueWithoutCredential(const WebCore::AuthenticationChallenge& authenticationChallenge)
-{
- notImplemented();
-}
-
-void Download::cancelAuthenticationChallenge(const WebCore::AuthenticationChallenge& authenticationChallenge)
-{
- notImplemented();
-}
-
-} // namespace WebKit
diff --git a/Source/WebKit2/WebProcess/Downloads/efl/DownloadSoupErrorsEfl.cpp b/Source/WebKit2/WebProcess/Downloads/efl/DownloadSoupErrorsEfl.cpp
new file mode 100644
index 000000000..d1ba587f3
--- /dev/null
+++ b/Source/WebKit2/WebProcess/Downloads/efl/DownloadSoupErrorsEfl.cpp
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2012 Intel Corporation. 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 "config.h"
+#include "DownloadSoupErrors.h"
+
+#include <WebCore/ErrorsEfl.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+ResourceError platformDownloadNetworkError(int errorCode, const String& failingURL, const String& localizedDescription)
+{
+ return downloadNetworkError(ResourceError(errorDomainDownload, errorCode, failingURL, localizedDescription));
+}
+
+ResourceError platformDownloadDestinationError(const ResourceResponse& response, const String& message)
+{
+ return downloadDestinationError(response, message);
+}
+
+} // namespace WebKit
diff --git a/Source/WebKit2/WebProcess/Downloads/efl/FileDownloaderEfl.cpp b/Source/WebKit2/WebProcess/Downloads/efl/FileDownloaderEfl.cpp
deleted file mode 100644
index 8f17840e1..000000000
--- a/Source/WebKit2/WebProcess/Downloads/efl/FileDownloaderEfl.cpp
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * 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
deleted file mode 100644
index d8f998be9..000000000
--- a/Source/WebKit2/WebProcess/Downloads/efl/FileDownloaderEfl.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * 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
diff --git a/Source/WebKit2/WebProcess/Downloads/gtk/DownloadSoupErrorsGtk.cpp b/Source/WebKit2/WebProcess/Downloads/gtk/DownloadSoupErrorsGtk.cpp
new file mode 100644
index 000000000..0d23e6e64
--- /dev/null
+++ b/Source/WebKit2/WebProcess/Downloads/gtk/DownloadSoupErrorsGtk.cpp
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2012 Intel Corporation. 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 "config.h"
+#include "DownloadSoupErrors.h"
+
+#include <WebCore/ErrorsGtk.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+ResourceError platformDownloadNetworkError(int errorCode, const String& failingURL, const String& localizedDescription)
+{
+ return downloadNetworkError(ResourceError(errorDomainDownload, errorCode, failingURL, localizedDescription));
+}
+
+ResourceError platformDownloadDestinationError(const ResourceResponse& response, const String& message)
+{
+ return downloadDestinationError(response, message);
+}
+
+} // namespace WebKit
diff --git a/Source/WebKit2/WebProcess/Downloads/soup/DownloadSoup.cpp b/Source/WebKit2/WebProcess/Downloads/soup/DownloadSoup.cpp
index 5c96eba48..bb295e09b 100644
--- a/Source/WebKit2/WebProcess/Downloads/soup/DownloadSoup.cpp
+++ b/Source/WebKit2/WebProcess/Downloads/soup/DownloadSoup.cpp
@@ -28,15 +28,18 @@
#include "Download.h"
#include "DataReference.h"
-#include <WebCore/ErrorsGtk.h>
+#include "DownloadSoupErrors.h"
#include <WebCore/NotImplemented.h>
#include <WebCore/ResourceHandleInternal.h>
#include <gio/gio.h>
-#include <glib/gi18n-lib.h>
#include <wtf/gobject/GOwnPtr.h>
#include <wtf/gobject/GRefPtr.h>
#include <wtf/text/CString.h>
+#if PLATFORM(GTK)
+#include <glib/gi18n-lib.h>
+#endif
+
using namespace WebCore;
namespace WebKit {
@@ -60,8 +63,7 @@ public:
m_download->didReceiveResponse(response);
if (response.httpStatusCode() >= 400) {
- downloadFailed(downloadNetworkError(ResourceError(errorDomainDownload, response.httpStatusCode(),
- response.url().string(), response.httpStatusText())));
+ downloadFailed(platformDownloadNetworkError(response.httpStatusCode(), response.url().string(), response.httpStatusText()));
return;
}
@@ -76,9 +78,13 @@ public:
bool overwrite;
String destinationURI = m_download->decideDestinationWithSuggestedFilename(suggestedFilename.utf8().data(), overwrite);
if (destinationURI.isEmpty()) {
- GOwnPtr<char> errorMessage(g_strdup_printf(_("Cannot determine destination URI for download with suggested filename %s"),
- suggestedFilename.utf8().data()));
- downloadFailed(downloadDestinationError(response, errorMessage.get()));
+#if PLATFORM(GTK)
+ GOwnPtr<char> buffer(g_strdup_printf(_("Cannot determine destination URI for download with suggested filename %s"), suggestedFilename.utf8().data()));
+ String errorMessage = String::fromUTF8(buffer.get());
+#else
+ String errorMessage = makeString("Cannot determine destination URI for download with suggested filename ", suggestedFilename);
+#endif
+ downloadFailed(platformDownloadDestinationError(response, errorMessage));
return;
}
@@ -86,7 +92,7 @@ public:
GOwnPtr<GError> error;
m_outputStream = adoptGRef(g_file_replace(file.get(), 0, TRUE, G_FILE_CREATE_NONE, 0, &error.outPtr()));
if (!m_outputStream) {
- downloadFailed(downloadDestinationError(response, error->message));
+ downloadFailed(platformDownloadDestinationError(response, error->message));
return;
}
@@ -99,7 +105,7 @@ public:
GOwnPtr<GError> error;
g_output_stream_write_all(G_OUTPUT_STREAM(m_outputStream.get()), data, length, &bytesWritten, 0, &error.outPtr());
if (error) {
- downloadFailed(downloadDestinationError(ResourceResponse(m_response.get()), error->message));
+ downloadFailed(platformDownloadDestinationError(ResourceResponse(m_response.get()), error->message));
return;
}
m_download->didReceiveData(bytesWritten);
@@ -113,7 +119,7 @@ public:
void didFail(ResourceHandle*, const ResourceError& error)
{
- downloadFailed(downloadNetworkError(error));
+ downloadFailed(platformDownloadNetworkError(error.errorCode(), error.failingURL(), error.localizedDescription()));
}
void wasBlocked(ResourceHandle*)
@@ -198,4 +204,19 @@ void Download::receivedCancellation(const AuthenticationChallenge& authenticatio
notImplemented();
}
+void Download::continueWithoutCredential(const AuthenticationChallenge &)
+{
+ notImplemented();
+}
+
+void Download::useCredential(const AuthenticationChallenge&, const Credential&)
+{
+ notImplemented();
+}
+
+void Download::cancelAuthenticationChallenge(const AuthenticationChallenge&)
+{
+ notImplemented();
+}
+
} // namespace WebKit
diff --git a/Source/WebKit2/WebProcess/Downloads/soup/DownloadSoupErrors.h b/Source/WebKit2/WebProcess/Downloads/soup/DownloadSoupErrors.h
new file mode 100644
index 000000000..89e23e083
--- /dev/null
+++ b/Source/WebKit2/WebProcess/Downloads/soup/DownloadSoupErrors.h
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2012 Intel Corporation. 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 DownloadSoupErrors_h
+#define DownloadSoupErrors_h
+
+#include <WebCore/ResourceHandle.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebKit {
+
+WebCore::ResourceError platformDownloadNetworkError(int errorCode, const String& failingURL, const String& localizedDescription);
+WebCore::ResourceError platformDownloadDestinationError(const WebCore::ResourceResponse&, const String& message);
+
+} // namespace WebKit
+
+#endif // DownloadSoupErrors_h
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebPopupMenu.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/WebPopupMenu.cpp
index 940cb95d8..4c309dcaf 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/WebPopupMenu.cpp
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebPopupMenu.cpp
@@ -59,9 +59,14 @@ void WebPopupMenu::didChangeSelectedIndex(int newIndex)
if (!m_popupClient)
return;
+#if PLATFORM(QT)
+ if (newIndex >= 0)
+ m_popupClient->listBoxSelectItem(newIndex, m_popupClient->multiple(), false);
+#else
m_popupClient->popupDidHide();
if (newIndex >= 0)
m_popupClient->valueChanged(newIndex);
+#endif
}
void WebPopupMenu::setTextForIndex(int index)
@@ -87,7 +92,7 @@ Vector<WebPopupItem> WebPopupMenu::populateItems()
// FIXME: Add support for styling the foreground and background colors.
// FIXME: Find a way to customize text color when an item is highlighted.
PopupMenuStyle itemStyle = m_popupClient->itemStyle(i);
- items.append(WebPopupItem(WebPopupItem::Item, m_popupClient->itemText(i), itemStyle.textDirection(), itemStyle.hasTextDirectionOverride(), m_popupClient->itemToolTip(i), m_popupClient->itemAccessibilityText(i), m_popupClient->itemIsEnabled(i), m_popupClient->itemIsLabel(i)));
+ items.append(WebPopupItem(WebPopupItem::Item, m_popupClient->itemText(i), itemStyle.textDirection(), itemStyle.hasTextDirectionOverride(), m_popupClient->itemToolTip(i), m_popupClient->itemAccessibilityText(i), m_popupClient->itemIsEnabled(i), m_popupClient->itemIsLabel(i), m_popupClient->itemIsSelected(i)));
}
}
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebPopupMenu.h b/Source/WebKit2/WebProcess/WebCoreSupport/WebPopupMenu.h
index 8e6625018..6319b9d55 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/WebPopupMenu.h
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebPopupMenu.h
@@ -48,7 +48,7 @@ public:
void disconnectFromPage() { m_page = 0; }
void didChangeSelectedIndex(int newIndex);
void setTextForIndex(int newIndex);
-#if PLATFORM(GTK)
+#if PLATFORM(GTK) || PLATFORM(QT)
WebCore::PopupMenuClient* client() const { return m_popupClient; }
#endif
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebVibrationClient.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/WebVibrationClient.cpp
index f635df45f..8a891753b 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/WebVibrationClient.cpp
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebVibrationClient.cpp
@@ -36,7 +36,7 @@ using namespace WebCore;
namespace WebKit {
-void WebVibrationClient::vibrate(const uint64_t& vibrationTime)
+void WebVibrationClient::vibrate(const unsigned long& vibrationTime)
{
WebProcess::shared().connection()->send(Messages::WebVibrationProxy::Vibrate(vibrationTime), m_page->pageID());
}
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebVibrationClient.h b/Source/WebKit2/WebProcess/WebCoreSupport/WebVibrationClient.h
index e71db2895..a06b4f9e1 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/WebVibrationClient.h
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebVibrationClient.h
@@ -44,7 +44,7 @@ public:
virtual ~WebVibrationClient() { }
private:
- virtual void vibrate(const uint64_t& vibrationTime) OVERRIDE;
+ virtual void vibrate(const unsigned long& vibrationTime) OVERRIDE;
virtual void cancelVibration() OVERRIDE;
virtual void vibrationDestroyed() OVERRIDE;
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/efl/WebErrorsEfl.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/efl/WebErrorsEfl.cpp
index dda93722a..9d8dfda0d 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/efl/WebErrorsEfl.cpp
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/efl/WebErrorsEfl.cpp
@@ -26,8 +26,7 @@
#include "config.h"
#include "WebErrors.h"
-#include "WKError.h"
-#include "WebError.h"
+#include <WebCore/ErrorsEfl.h>
#include <WebCore/ResourceError.h>
#include <WebCore/ResourceRequest.h>
#include <WebCore/ResourceResponse.h>
@@ -36,47 +35,39 @@ using namespace WebCore;
namespace WebKit {
-// FIXME: Export following error codes so that application can understand.
-// We should establish Efl port's error system because application cannot understand those local define.
-// See https://bugs.webkit.org/show_bug.cgi?id=90783 for detail.
-enum {
- kWKErrorCodeCancelled = 300,
- kWKErrorCodeFileDoesNotExist = 301,
-};
-
ResourceError cancelledError(const ResourceRequest& request)
{
- return ResourceError(WebError::webKitErrorDomain(), kWKErrorCodeCancelled, request.url().string(), "Request cancelled");
+ return WebCore::cancelledError(request);
}
ResourceError blockedError(const ResourceRequest& request)
{
- return ResourceError(WebError::webKitErrorDomain(), kWKErrorCodeCannotUseRestrictedPort, request.url().string(), "Request blocked");
+ return WebCore::blockedError(request);
}
ResourceError cannotShowURLError(const ResourceRequest& request)
{
- return ResourceError(WebError::webKitErrorDomain(), kWKErrorCodeCannotShowURL, request.url().string(), "Cannot show URL");
+ return WebCore::cannotShowURLError(request);
}
ResourceError interruptedForPolicyChangeError(const ResourceRequest& request)
{
- return ResourceError(WebError::webKitErrorDomain(), kWKErrorCodeFrameLoadInterruptedByPolicyChange, request.url().string(), "Frame load interrupted by policy change");
+ return WebCore::interruptedForPolicyChangeError(request);
}
ResourceError cannotShowMIMETypeError(const ResourceResponse& response)
{
- return ResourceError(WebError::webKitErrorDomain(), kWKErrorCodeCannotShowMIMEType, response.url().string(), "Cannot show mimetype");
+ return WebCore::cannotShowMIMETypeError(response);
}
ResourceError fileDoesNotExistError(const ResourceResponse& response)
{
- return ResourceError(WebError::webKitErrorDomain(), kWKErrorCodeFileDoesNotExist, response.url().string(), "File does not exist");
+ return WebCore::fileDoesNotExistError(response);
}
ResourceError pluginWillHandleLoadError(const ResourceResponse& response)
{
- return ResourceError(WebError::webKitErrorDomain(), kWKErrorCodePlugInWillHandleLoad, response.url().string(), "Plugin will handle load");
+ return WebCore::pluginWillHandleLoadError(response);
}
} // namespace WebKit
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/qt/WebPopupMenuQt.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/qt/WebPopupMenuQt.cpp
index b21f06ccf..f0a8f7763 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/qt/WebPopupMenuQt.cpp
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/qt/WebPopupMenuQt.cpp
@@ -27,13 +27,15 @@
#include "WebPopupMenu.h"
#include "PlatformPopupMenuData.h"
+#include <WebCore/PopupMenuClient.h>
using namespace WebCore;
namespace WebKit {
-void WebPopupMenu::setUpPlatformData(const IntRect&, PlatformPopupMenuData&)
+void WebPopupMenu::setUpPlatformData(const IntRect&, PlatformPopupMenuData& data)
{
+ data.multipleSelections = m_popupClient->multiple();
}
} // namespace WebKit
diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
index 77987f26c..9571ffbaa 100644
--- a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
@@ -138,6 +138,10 @@
#include "IntentData.h"
#endif
+#if ENABLE(VIBRATION)
+#include "WebVibrationClient.h"
+#endif
+
#if PLATFORM(MAC)
#include "BuiltInPDFView.h"
#endif
@@ -288,6 +292,9 @@ WebPage::WebPage(uint64_t pageID, const WebPageCreationParameters& parameters)
#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
WebCore::provideNotification(m_page.get(), new WebNotificationClient(this));
#endif
+#if ENABLE(VIBRATION)
+ WebCore::provideVibrationTo(m_page.get(), new WebVibrationClient(this));
+#endif
// Qt does not yet call setIsInWindow. Until it does, just leave
// this line out so plug-ins and video will work. Eventually all platforms
@@ -2394,11 +2401,16 @@ void WebPage::countStringMatches(const String& string, uint32_t options, uint32_
void WebPage::didChangeSelectedIndexForActivePopupMenu(int32_t newIndex)
{
+ changeSelectedIndex(newIndex);
+ m_activePopupMenu = 0;
+}
+
+void WebPage::changeSelectedIndex(int32_t index)
+{
if (!m_activePopupMenu)
return;
- m_activePopupMenu->didChangeSelectedIndex(newIndex);
- m_activePopupMenu = 0;
+ m_activePopupMenu->didChangeSelectedIndex(index);
}
void WebPage::didChooseFilesForOpenPanel(const Vector<String>& files)
diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.h b/Source/WebKit2/WebProcess/WebPage/WebPage.h
index 4d20421e0..1b7708a4c 100644
--- a/Source/WebKit2/WebProcess/WebPage/WebPage.h
+++ b/Source/WebKit2/WebProcess/WebPage/WebPage.h
@@ -697,6 +697,10 @@ private:
#if PLATFORM(GTK)
void failedToShowPopupMenu();
#endif
+#if PLATFORM(QT)
+ void hidePopupMenu();
+ void selectedIndex(int32_t newIndex);
+#endif
void didChooseFilesForOpenPanel(const Vector<String>&);
void didCancelForOpenPanel();
@@ -724,6 +728,7 @@ private:
void didSelectItemFromActiveContextMenu(const WebContextMenuItemData&);
#endif
+ void changeSelectedIndex(int32_t index);
void setCanStartMediaTimerFired();
static bool platformCanHandleRequest(const WebCore::ResourceRequest&);
diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in b/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in
index 4c260eb90..39c8114b5 100644
--- a/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in
+++ b/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in
@@ -166,7 +166,11 @@ messages -> WebPage {
SetTextForActivePopupMenu(int32_t index);
#if PLATFORM(GTK)
FailedToShowPopupMenu();
-#endif
+#endif
+#if PLATFORM(QT)
+ HidePopupMenu();
+ SelectedIndex(int32_t newIndex);
+#endif
#if ENABLE(CONTEXT_MENUS)
# Context menu.
diff --git a/Source/WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp b/Source/WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp
index 2e90a7360..18e4f948a 100644
--- a/Source/WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp
@@ -28,9 +28,11 @@
#include "WebPage.h"
#include "NotImplemented.h"
+#include "PopupMenuClient.h"
#include "WebEditorClient.h"
#include "WebEvent.h"
#include "WebPageProxyMessages.h"
+#include "WebPopupMenu.h"
#include "WebProcess.h"
#include <WebCore/DOMWrapperWorld.h>
#include <WebCore/FocusController.h>
@@ -422,4 +424,18 @@ void WebPage::setUserScripts(const Vector<String>& scripts)
pageGroup->addUserScriptToWorld(mainThreadNormalWorld(), scripts.at(i), KURL(), nullptr, nullptr, InjectAtDocumentEnd, InjectInTopFrameOnly);
}
+void WebPage::selectedIndex(int32_t newIndex)
+{
+ changeSelectedIndex(newIndex);
+}
+
+void WebPage::hidePopupMenu()
+{
+ if (!m_activePopupMenu)
+ return;
+
+ m_activePopupMenu->client()->popupDidHide();
+ m_activePopupMenu = 0;
+}
+
} // namespace WebKit
diff --git a/Source/WebKit2/WebProcess/efl/WebProcessMainEfl.cpp b/Source/WebKit2/WebProcess/efl/WebProcessMainEfl.cpp
index 92d3516a5..16278a38e 100644
--- a/Source/WebKit2/WebProcess/efl/WebProcessMainEfl.cpp
+++ b/Source/WebKit2/WebProcess/efl/WebProcessMainEfl.cpp
@@ -26,6 +26,7 @@
#include "config.h"
#include "WebProcessMainEfl.h"
+#include "ProxyResolverSoup.h"
#include "WKBase.h"
#include <Ecore.h>
#include <WebCore/ResourceHandle.h>
@@ -67,11 +68,12 @@ WK_EXPORT int WebProcessMainEfl(int argc, char* argv[])
RunLoop::initializeMainRunLoop();
SoupSession* session = WebCore::ResourceHandle::defaultSession();
- const char* httpProxy = g_getenv("http_proxy");
+ const char* httpProxy = getenv("http_proxy");
if (httpProxy) {
- SoupURI* proxyUri = soup_uri_new(httpProxy);
- g_object_set(session, SOUP_SESSION_PROXY_URI, proxyUri, NULL);
- soup_uri_free(proxyUri);
+ const char* noProxy = getenv("no_proxy");
+ SoupProxyURIResolver* resolverEfl = soupProxyResolverWkNew(httpProxy, noProxy);
+ soup_session_add_feature(session, SOUP_SESSION_FEATURE(resolverEfl));
+ g_object_unref(resolverEfl);
}
int socket = atoi(argv[1]);
diff --git a/Source/WebKit2/WebProcess/qt/QtNetworkAccessManager.cpp b/Source/WebKit2/WebProcess/qt/QtNetworkAccessManager.cpp
index ce46be854..2251c2ed1 100644
--- a/Source/WebKit2/WebProcess/qt/QtNetworkAccessManager.cpp
+++ b/Source/WebKit2/WebProcess/qt/QtNetworkAccessManager.cpp
@@ -45,7 +45,9 @@ QtNetworkAccessManager::QtNetworkAccessManager(WebProcess* webProcess)
{
connect(this, SIGNAL(authenticationRequired(QNetworkReply*, QAuthenticator*)), SLOT(onAuthenticationRequired(QNetworkReply*, QAuthenticator*)));
connect(this, SIGNAL(proxyAuthenticationRequired(const QNetworkProxy&, QAuthenticator*)), SLOT(onProxyAuthenticationRequired(const QNetworkProxy&, QAuthenticator*)));
+#ifndef QT_NO_SSL
connect(this, SIGNAL(sslErrors(QNetworkReply*, QList<QSslError>)), SLOT(onSslErrors(QNetworkReply*, QList<QSslError>)));
+#endif
}
WebPage* QtNetworkAccessManager::obtainOriginatingWebPage(const QNetworkRequest& request)
@@ -126,6 +128,7 @@ void QtNetworkAccessManager::onAuthenticationRequired(QNetworkReply* reply, QAut
void QtNetworkAccessManager::onSslErrors(QNetworkReply* reply, const QList<QSslError>& qSslErrors)
{
+#ifndef QT_NO_SSL
WebPage* webPage = obtainOriginatingWebPage(reply->request());
// FIXME: This check can go away once our Qt version is up-to-date. See: QTBUG-23512.
@@ -138,15 +141,10 @@ void QtNetworkAccessManager::onSslErrors(QNetworkReply* reply, const QList<QSslE
if (webPage->sendSync(
Messages::WebPageProxy::CertificateVerificationRequest(hostname),
Messages::WebPageProxy::CertificateVerificationRequest::Reply(ignoreErrors))) {
- if (ignoreErrors) {
-#ifndef QT_NO_OPENSSL
+ if (ignoreErrors)
reply->ignoreSslErrors(qSslErrors);
-#else
- Q_UNUSED(qSslErrors);
- reply->ignoreSslErrors();
-#endif
- }
}
+#endif
}
}