diff options
author | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2017-05-30 12:48:17 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2017-05-30 12:48:17 +0200 |
commit | 881da28418d380042aa95a97f0cbd42560a64f7c (patch) | |
tree | a794dff3274695e99c651902dde93d934ea7a5af /Source/WebKit2/UIProcess/qt | |
parent | 7e104c57a70fdf551bb3d22a5d637cdcbc69dbea (diff) | |
parent | 0fcedcd17cc00d3dd44c718b3cb36c1033319671 (diff) | |
download | qtwebkit-881da28418d380042aa95a97f0cbd42560a64f7c.tar.gz |
Merge 'wip/next' into dev
Change-Id: Iff9ee5e23bb326c4371ec8ed81d56f2f05d680e9
Diffstat (limited to 'Source/WebKit2/UIProcess/qt')
39 files changed, 643 insertions, 329 deletions
diff --git a/Source/WebKit2/UIProcess/qt/BackingStoreQt.cpp b/Source/WebKit2/UIProcess/qt/BackingStoreQt.cpp index 1af16d842..a44ed681d 100644 --- a/Source/WebKit2/UIProcess/qt/BackingStoreQt.cpp +++ b/Source/WebKit2/UIProcess/qt/BackingStoreQt.cpp @@ -28,8 +28,8 @@ #include "config.h" #include "BackingStore.h" -#include "UpdateInfo.h" #include "ShareableBitmap.h" +#include "UpdateInfo.h" #include <WebCore/GraphicsContext.h> #include <WebCore/IntRect.h> diff --git a/Source/WebKit2/UIProcess/qt/PageViewportControllerClientQt.cpp b/Source/WebKit2/UIProcess/qt/PageViewportControllerClientQt.cpp index f72946529..adac7bb80 100644 --- a/Source/WebKit2/UIProcess/qt/PageViewportControllerClientQt.cpp +++ b/Source/WebKit2/UIProcess/qt/PageViewportControllerClientQt.cpp @@ -41,7 +41,8 @@ namespace WebKit { static const int kScaleAnimationDurationMillis = 250; PageViewportControllerClientQt::PageViewportControllerClientQt(QQuickWebView* viewportItem, QQuickWebPage* pageItem) - : m_viewportItem(viewportItem) + : m_controller(nullptr) + , m_viewportItem(viewportItem) , m_pageItem(pageItem) , m_scaleChange(this) , m_scrollChange(this) @@ -274,7 +275,7 @@ void PageViewportControllerClientQt::zoomToAreaGestureEnded(const QPointF& touch // Zoom back out if attempting to scale to the same current scale, or // attempting to continue scaling out from the inner most level. // Use fuzzy compare with a fixed error to be able to deal with largish differences due to pixel rounding. - if (!m_scaleStack.isEmpty() && fuzzyCompare(targetScale, currentScale, 0.01)) { + if (!m_scaleStack.isEmpty() && WTF::areEssentiallyEqual(targetScale, currentScale, qreal(0.01))) { // If moving the viewport would expose more of the targetRect and move at least 40 pixels, update position but do not scale out. QRectF currentContentRect(m_viewportItem->mapRectToWebContent(viewportRect)); QRectF targetIntersection = endVisibleContentRect.intersected(targetArea); @@ -284,7 +285,7 @@ void PageViewportControllerClientQt::zoomToAreaGestureEnded(const QPointF& touch zoomAction = NoZoom; else zoomAction = ZoomBack; - } else if (fuzzyCompare(targetScale, m_zoomOutScale, 0.01)) + } else if (WTF::areEssentiallyEqual(targetScale, m_zoomOutScale, qreal(0.01))) zoomAction = ZoomBack; else if (targetScale < currentScale) zoomAction = ZoomOut; diff --git a/Source/WebKit2/UIProcess/qt/PageViewportControllerClientQt.h b/Source/WebKit2/UIProcess/qt/PageViewportControllerClientQt.h index c0b75cee1..f1b8afd15 100644 --- a/Source/WebKit2/UIProcess/qt/PageViewportControllerClientQt.h +++ b/Source/WebKit2/UIProcess/qt/PageViewportControllerClientQt.h @@ -40,21 +40,21 @@ class QWebKitTest; namespace WebKit { -class PageViewportControllerClientQt : public QObject, public PageViewportControllerClient { +class PageViewportControllerClientQt final : public QObject, public PageViewportControllerClient { Q_OBJECT public: PageViewportControllerClientQt(QQuickWebView*, QQuickWebPage*); - ~PageViewportControllerClientQt(); + ~PageViewportControllerClientQt() final; - virtual void setViewportPosition(const WebCore::FloatPoint& contentsPoint); - virtual void setPageScaleFactor(float); + void setViewportPosition(const WebCore::FloatPoint& contentsPoint) final; + void setPageScaleFactor(float) final; - virtual void didChangeContentsSize(const WebCore::IntSize&); - virtual void didChangeVisibleContents(); - virtual void didChangeViewportAttributes(); + void didChangeContentsSize(const WebCore::IntSize&) final; + void didChangeVisibleContents() final; + void didChangeViewportAttributes() final; - virtual void setController(PageViewportController* controller) { m_controller = controller; } + void setController(PageViewportController* controller) { m_controller = controller; } // Additional methods currently only relevant in the QQuick context. void touchBegin(); @@ -89,7 +89,7 @@ private Q_SLOTS: void flickMoveEnded(); // Called when panning (+ kinetic animation) ends. private: - class ScaleAnimation : public QVariantAnimation { + class ScaleAnimation final : public QVariantAnimation { PageViewportControllerClientQt* m_controllerClient; public: ScaleAnimation(PageViewportControllerClientQt* parent) @@ -97,7 +97,7 @@ private: , m_controllerClient(parent) { } - virtual void updateCurrentValue(const QVariant&); + void updateCurrentValue(const QVariant&) final; }; class ViewportInteractionTracker { diff --git a/Source/WebKit2/UIProcess/qt/QrcSchemeHandler.cpp b/Source/WebKit2/UIProcess/qt/QrcSchemeHandler.cpp new file mode 100644 index 000000000..9b07e3e32 --- /dev/null +++ b/Source/WebKit2/UIProcess/qt/QrcSchemeHandler.cpp @@ -0,0 +1,96 @@ +/* + * Copyright (C) 2017 Konstantin Tokarev <annulen@yandex.ru> + * + * 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 "QrcSchemeHandler.h" + +#include <QCoreApplication> +#include <QFile> +#include <QFileInfo> +#include <QMimeDatabase> +#include <QNetworkReply> +#include <WebCore/ResourceError.h> +#include <WebCore/ResourceResponse.h> +#include <WebCore/SharedBuffer.h> + +using namespace WebCore; + +namespace WebKit { + +Ref<QrcSchemeHandler> QrcSchemeHandler::create() +{ + return adoptRef(*new QrcSchemeHandler()); +} + +static void sendResponse(WebURLSchemeHandlerTask& task, const QString& fileName, const QByteArray& fileData) +{ + QMimeDatabase mimeDb; + QMimeType mimeType = mimeDb.mimeTypeForFileNameAndData(fileName, fileData); + + WebCore::ResourceResponse response(task.request().url(), mimeType.name(), fileData.size(), String()); + auto result = task.didReceiveResponse(response); + ASSERT_UNUSED(result, result == WebURLSchemeHandlerTask::ExceptionType::None); +} + +static void sendError(WebURLSchemeHandlerTask& task) +{ + // QTFIXME: Move error templates to ErrorsQt + WebCore::ResourceError error("QtNetwork", QNetworkReply::ContentNotFoundError, task.request().url(), + QCoreApplication::translate("QWebFrame", "File does not exist")); + + auto result = task.didComplete(error); + ASSERT_UNUSED(result, result == WebURLSchemeHandlerTask::ExceptionType::None); +} + +void QrcSchemeHandler::platformStartTask(WebPageProxy& page, WebURLSchemeHandlerTask& task) +{ + QString fileName = ':' + QString(task.request().url().path()); + QByteArray fileData; + + { + QFile file(fileName); + QFileInfo fileInfo(file); + if (fileInfo.isDir() || !file.open(QIODevice::ReadOnly | QIODevice::Unbuffered)) { + sendError(task); + return; + } + fileData = file.readAll(); + } + + sendResponse(task, fileName, fileData); + + // TODO: Wrap SharedBuffer around QByteArray when it's possible + auto result = task.didReceiveData(*SharedBuffer::create(fileData.data(), fileData.size())); + ASSERT_UNUSED(result, result == WebURLSchemeHandlerTask::ExceptionType::None); + + result = task.didComplete(WebCore::ResourceError()); + ASSERT_UNUSED(result, result == WebURLSchemeHandlerTask::ExceptionType::None); +} + +void QrcSchemeHandler::platformStopTask(WebPageProxy&, WebURLSchemeHandlerTask&) +{ +} + +} // namespace WebKit diff --git a/Source/WebKit2/UIProcess/qt/WebProcessProxyQt.cpp b/Source/WebKit2/UIProcess/qt/QrcSchemeHandler.h index e8b173d07..2350c97b3 100644 --- a/Source/WebKit2/UIProcess/qt/WebProcessProxyQt.cpp +++ b/Source/WebKit2/UIProcess/qt/QrcSchemeHandler.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012 Apple Inc. All rights reserved. + * Copyright (C) 2017 Konstantin Tokarev <annulen@yandex.ru> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -23,13 +23,21 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#include "config.h" -#include "WebProcessProxy.h" +#pragma once + +#include "WebURLSchemeHandler.h" namespace WebKit { -void WebProcessProxy::platformGetLaunchOptions(ProcessLauncher::LaunchOptions&) -{ -} +class QrcSchemeHandler final : public WebURLSchemeHandler { +public: + static Ref<QrcSchemeHandler> create(); + +private: + QrcSchemeHandler() = default; + + void platformStartTask(WebPageProxy&, WebURLSchemeHandlerTask&) final; + void platformStopTask(WebPageProxy&, WebURLSchemeHandlerTask&) final; +}; } // namespace WebKit diff --git a/Source/WebKit2/UIProcess/qt/QtDialogRunner.cpp b/Source/WebKit2/UIProcess/qt/QtDialogRunner.cpp index 0dd547102..5043a170f 100644 --- a/Source/WebKit2/UIProcess/qt/QtDialogRunner.cpp +++ b/Source/WebKit2/UIProcess/qt/QtDialogRunner.cpp @@ -29,7 +29,6 @@ #include <QtQml/QQmlContext> #include <QtQml/QQmlEngine> #include <QtQuick/QQuickItem> -#include <wtf/PassOwnPtr.h> namespace WebKit { @@ -413,24 +412,23 @@ bool QtDialogRunner::createDialog(QQmlComponent* component, QObject* contextObje QQmlContext* baseContext = component->creationContext(); if (!baseContext) baseContext = QQmlEngine::contextForObject(m_webView); - m_dialogContext = adoptPtr(new QQmlContext(baseContext)); + m_dialogContext = std::make_unique<QQmlContext>(baseContext); // This makes both "message" and "model.message" work for the dialog, // just like QtQuick's ListView delegates. contextObject->setParent(m_dialogContext.get()); - m_dialogContext->setContextProperty(QLatin1String("model"), contextObject); + m_dialogContext->setContextProperty(QStringLiteral("model"), contextObject); m_dialogContext->setContextObject(contextObject); QObject* object = component->beginCreate(m_dialogContext.get()); if (!object) { - m_dialogContext.clear(); + m_dialogContext = nullptr; return false; } - m_dialog = adoptPtr(qobject_cast<QQuickItem*>(object)); + m_dialog.reset(qobject_cast<QQuickItem*>(object)); if (!m_dialog) { - m_dialogContext.clear(); - m_dialog.clear(); + m_dialogContext = nullptr; return false; } @@ -480,4 +478,3 @@ void QtDialogRunner::onDatabaseQuotaAccepted(quint64 quota) #include "QtDialogRunner.moc" #include "moc_QtDialogRunner.cpp" - diff --git a/Source/WebKit2/UIProcess/qt/QtDialogRunner.h b/Source/WebKit2/UIProcess/qt/QtDialogRunner.h index b70044076..7f4fec3c2 100644 --- a/Source/WebKit2/UIProcess/qt/QtDialogRunner.h +++ b/Source/WebKit2/UIProcess/qt/QtDialogRunner.h @@ -21,11 +21,10 @@ #ifndef QtDialogRunner_h #define QtDialogRunner_h -#include "WKSecurityOrigin.h" +#include "WKSecurityOriginRef.h" #include "qquickwebview_p.h" #include <QtCore/QEventLoop> #include <QtCore/QStringList> -#include <wtf/OwnPtr.h> QT_BEGIN_NAMESPACE class QQmlComponent; @@ -35,7 +34,7 @@ QT_END_NAMESPACE namespace WebKit { -class QtDialogRunner : public QEventLoop { +class QtDialogRunner final : public QEventLoop { Q_OBJECT public: @@ -75,8 +74,8 @@ private: bool createDialog(QQmlComponent*, QObject* contextObject); QQuickWebView* m_webView; - OwnPtr<QQmlContext> m_dialogContext; - OwnPtr<QQuickItem> m_dialog; + std::unique_ptr<QQmlContext> m_dialogContext; + std::unique_ptr<QQuickItem> m_dialog; QString m_result; bool m_wasAccepted; diff --git a/Source/WebKit2/UIProcess/qt/QtDownloadManager.cpp b/Source/WebKit2/UIProcess/qt/QtDownloadManager.cpp index 514a3e554..c5b7ef1da 100644 --- a/Source/WebKit2/UIProcess/qt/QtDownloadManager.cpp +++ b/Source/WebKit2/UIProcess/qt/QtDownloadManager.cpp @@ -39,16 +39,16 @@ static inline QtDownloadManager* toQtDownloadManager(const void* clientInfo) QtDownloadManager::QtDownloadManager(WKContextRef context) { - WKContextDownloadClient downloadClient; - memset(&downloadClient, 0, sizeof(WKContextDownloadClient)); - downloadClient.version = kWKContextDownloadClientCurrentVersion; - downloadClient.clientInfo = this; + WKContextDownloadClientV0 downloadClient; + memset(&downloadClient, 0, sizeof(WKContextDownloadClientV0)); + downloadClient.base.version = 0; + downloadClient.base.clientInfo = this; downloadClient.didReceiveResponse = didReceiveResponse; downloadClient.didReceiveData = didReceiveDataForDownload; downloadClient.didCreateDestination = didCreateDestination; downloadClient.didFinish = didFinishDownload; downloadClient.didFail = didFailDownload; - WKContextSetDownloadClient(context, &downloadClient); + WKContextSetDownloadClient(context, &downloadClient.base); } QtDownloadManager::~QtDownloadManager() diff --git a/Source/WebKit2/UIProcess/qt/QtPageClient.cpp b/Source/WebKit2/UIProcess/qt/QtPageClient.cpp index e053aa426..c4edb793e 100644 --- a/Source/WebKit2/UIProcess/qt/QtPageClient.cpp +++ b/Source/WebKit2/UIProcess/qt/QtPageClient.cpp @@ -63,7 +63,7 @@ void QtPageClient::initialize(QQuickWebView* webView, QtWebPageEventHandler* eve m_undoController = undoController; } -PassOwnPtr<DrawingAreaProxy> QtPageClient::createDrawingAreaProxy() +std::unique_ptr<DrawingAreaProxy> QtPageClient::createDrawingAreaProxy() { return QQuickWebViewPrivate::get(m_webView)->createDrawingAreaProxy(); } @@ -88,7 +88,7 @@ void QtPageClient::pageDidRequestScroll(const IntPoint& pos) QQuickWebViewPrivate::get(m_webView)->pageDidRequestScroll(pos); } -void QtPageClient::processDidCrash() +void QtPageClient::processDidExit() { QQuickWebViewPrivate::get(m_webView)->processDidCrash(); } @@ -98,7 +98,7 @@ void QtPageClient::didRelaunchProcess() QQuickWebViewPrivate::get(m_webView)->didRelaunchProcess(); } -void QtPageClient::didChangeContentsSize(const IntSize& newSize) +void QtPageClient::didChangeContentSize(const IntSize& newSize) { PageViewportController* pvc = QQuickWebViewPrivate::get(m_webView)->viewportController(); if (pvc) @@ -199,38 +199,33 @@ FloatRect QtPageClient::convertToUserSpace(const FloatRect& rect) return rect; } -IntPoint QtPageClient::screenToWindow(const IntPoint& point) +IntPoint QtPageClient::screenToRootView(const IntPoint& point) { return point; } -IntRect QtPageClient::windowToScreen(const IntRect& rect) +IntRect QtPageClient::rootViewToScreen(const IntRect& rect) { return rect; } -PassRefPtr<WebPopupMenuProxy> QtPageClient::createPopupMenuProxy(WebPageProxy* webPageProxy) +RefPtr<WebPopupMenuProxy> QtPageClient::createPopupMenuProxy(WebPageProxy& webPageProxy) { return WebPopupMenuProxyQt::create(webPageProxy, m_webView); } -PassRefPtr<WebContextMenuProxy> QtPageClient::createContextMenuProxy(WebPageProxy* webPageProxy) +std::unique_ptr<WebContextMenuProxy> QtPageClient::createContextMenuProxy(WebPageProxy&, const ContextMenuContextData& context, const UserData& userData) { - return WebContextMenuProxyQt::create(webPageProxy); + return std::make_unique<WebContextMenuProxyQt>(context, userData); } #if ENABLE(INPUT_TYPE_COLOR) -PassRefPtr<WebColorPicker> QtPageClient::createColorPicker(WebPageProxy* webPageProxy, const WebCore::Color& initialColor, const WebCore::IntRect& elementRect) +RefPtr<WebColorPicker> QtPageClient::createColorPicker(WebPageProxy* webPageProxy, const WebCore::Color& initialColor, const WebCore::IntRect& elementRect) { return WebColorPickerQt::create(webPageProxy, m_webView, initialColor, elementRect); } #endif -void QtPageClient::flashBackingStoreUpdates(const Vector<IntRect>&) -{ - notImplemented(); -} - void QtPageClient::pageTransitionViewportReady() { PageViewportController* pvc = QQuickWebViewPrivate::get(m_webView)->viewportController(); @@ -256,7 +251,7 @@ void QtPageClient::handleWillSetInputMethodState() m_eventHandler->handleWillSetInputMethodState(); } -#if ENABLE(GESTURE_EVENTS) +#if ENABLE(QT_GESTURE_EVENTS) void QtPageClient::doneWithGestureEvent(const WebGestureEvent& event, bool wasEventHandled) { ASSERT(m_eventHandler); @@ -272,6 +267,43 @@ void QtPageClient::doneWithTouchEvent(const NativeWebTouchEvent& event, bool was } #endif +WebFullScreenManagerProxyClient& QtPageClient::fullScreenManagerProxyClient() +{ + return *this; +} + +// QTFIXME: #419 +void QtPageClient::closeFullScreenManager() +{ + notImplemented(); +} + +bool QtPageClient::isFullScreen() +{ + notImplemented(); + return false; +} + +void QtPageClient::enterFullScreen() +{ + notImplemented(); +} + +void QtPageClient::exitFullScreen() +{ + notImplemented(); +} + +void QtPageClient::beganEnterFullScreen(const IntRect& initialFrame, const IntRect& finalFrame) +{ + notImplemented(); +} + +void QtPageClient::beganExitFullScreen(const IntRect& initialFrame, const IntRect& finalFrame) +{ + notImplemented(); +} + void QtPageClient::displayView() { // FIXME: Implement. @@ -333,4 +365,84 @@ void QtPageClient::updateAcceleratedCompositingMode(const LayerTreeContext&) // FIXME: Implement. } +void QtPageClient::requestScroll(const FloatPoint& scrollPosition, const IntPoint& scrollOrigin, bool isProgrammaticScroll) +{ +} + +void QtPageClient::didCommitLoadForMainFrame(const WTF::String& mimeType, bool useCustomContentProvider) +{ +} + +void QtPageClient::willEnterAcceleratedCompositingMode() +{ +} + +void QtPageClient::didFinishLoadingDataForCustomContentProvider(const WTF::String& suggestedFilename, const IPC::DataReference&) +{ +} + +void QtPageClient::navigationGestureDidBegin() +{ +} + +void QtPageClient::navigationGestureWillEnd(bool willNavigate, WebKit::WebBackForwardListItem&) +{ +} + +void QtPageClient::navigationGestureDidEnd(bool willNavigate, WebKit::WebBackForwardListItem&) +{ +} + +void QtPageClient::navigationGestureDidEnd() +{ +} + +void QtPageClient::willRecordNavigationSnapshot(WebKit::WebBackForwardListItem&) +{ +} + +void QtPageClient::didRemoveNavigationGestureSnapshot() +{ +} + +void QtPageClient::didFirstVisuallyNonEmptyLayoutForMainFrame() +{ +} + +void QtPageClient::didFinishLoadForMainFrame() +{ +} + +void QtPageClient::didFailLoadForMainFrame() +{ +} + +void QtPageClient::didSameDocumentNavigationForMainFrame(WebKit::SameDocumentNavigationType) +{ +} + +void QtPageClient::didChangeBackgroundColor() +{ +} + +void QtPageClient::refView() +{ +} + +void QtPageClient::derefView() +{ +} + +#if ENABLE(VIDEO) && USE(GSTREAMER) +bool QtPageClient::decidePolicyForInstallMissingMediaPluginsPermissionRequest(WebKit::InstallMissingMediaPluginsPermissionRequest&) +{ + // QTFIXME + return false; +} +#endif + +void QtPageClient::didRestoreScrollPosition() +{ +} + } // namespace WebKit diff --git a/Source/WebKit2/UIProcess/qt/QtPageClient.h b/Source/WebKit2/UIProcess/qt/QtPageClient.h index e6d9db307..3467ceaa9 100644 --- a/Source/WebKit2/UIProcess/qt/QtPageClient.h +++ b/Source/WebKit2/UIProcess/qt/QtPageClient.h @@ -21,8 +21,8 @@ #ifndef QtPageClient_h #define QtPageClient_h -#include "FindIndicator.h" #include "PageClient.h" +#include "WebFullScreenManagerProxy.h" class QQuickWebView; @@ -34,7 +34,11 @@ class QtWebPageEventHandler; class DefaultUndoController; class ShareableBitmap; -class QtPageClient : public PageClient { +class QtPageClient final : public PageClient +#if ENABLE(FULLSCREEN_API) + , public WebFullScreenManagerProxyClient +#endif +{ public: QtPageClient(); ~QtPageClient(); @@ -42,71 +46,105 @@ public: void initialize(QQuickWebView*, QtWebPageEventHandler*, WebKit::DefaultUndoController*); // QQuickWebView. - virtual void setViewNeedsDisplay(const WebCore::IntRect&); - virtual void didRenderFrame(const WebCore::IntSize& contentsSize, const WebCore::IntRect& coveredRect); - virtual WebCore::IntSize viewSize(); - virtual bool isViewFocused(); - virtual bool isViewVisible(); - virtual void pageDidRequestScroll(const WebCore::IntPoint&); - virtual void didChangeContentsSize(const WebCore::IntSize&); - virtual void didChangeViewportProperties(const WebCore::ViewportAttributes&); - virtual void processDidCrash(); - virtual void didRelaunchProcess(); - virtual PassOwnPtr<DrawingAreaProxy> createDrawingAreaProxy(); - virtual void handleDownloadRequest(DownloadProxy*); - virtual void handleApplicationSchemeRequest(PassRefPtr<QtRefCountedNetworkRequestData>); - virtual void handleAuthenticationRequiredRequest(const String& hostname, const String& realm, const String& prefilledUsername, String& username, String& password); - virtual void handleCertificateVerificationRequest(const String& hostname, bool& ignoreErrors); - virtual void handleProxyAuthenticationRequiredRequest(const String& hostname, uint16_t port, const String& prefilledUsername, String& username, String& password); - - virtual void displayView(); - virtual bool canScrollView() { return false; } - virtual void scrollView(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollOffset); - virtual bool isViewWindowActive(); - virtual bool isViewInWindow(); -#if USE(ACCELERATED_COMPOSITING) - virtual void enterAcceleratedCompositingMode(const LayerTreeContext&); - virtual void exitAcceleratedCompositingMode(); - virtual void updateAcceleratedCompositingMode(const LayerTreeContext&); -#endif // USE(ACCELERATED_COMPOSITING) - virtual void pageClosed() { } - virtual void preferencesDidChange() { } - virtual void startDrag(const WebCore::DragData&, PassRefPtr<ShareableBitmap> dragImage); - virtual void setCursor(const WebCore::Cursor&); - virtual void setCursorHiddenUntilMouseMoves(bool); - virtual void toolTipChanged(const String&, const String&); + void setViewNeedsDisplay(const WebCore::IntRect&) override; + void didRenderFrame(const WebCore::IntSize& contentsSize, const WebCore::IntRect& coveredRect) override; + WebCore::IntSize viewSize() override; + bool isViewFocused() override; + bool isViewVisible() override; + void pageDidRequestScroll(const WebCore::IntPoint&) override; + void didChangeContentSize(const WebCore::IntSize&) override; + void didChangeViewportProperties(const WebCore::ViewportAttributes&) override; + void processDidExit() override; + void didRelaunchProcess() override; + std::unique_ptr<DrawingAreaProxy> createDrawingAreaProxy() override; + void handleDownloadRequest(DownloadProxy*) override; + void handleApplicationSchemeRequest(PassRefPtr<QtRefCountedNetworkRequestData>); // QTFIXME + void handleAuthenticationRequiredRequest(const String& hostname, const String& realm, const String& prefilledUsername, String& username, String& password) override; + void handleCertificateVerificationRequest(const String& hostname, bool& ignoreErrors) override; + void handleProxyAuthenticationRequiredRequest(const String& hostname, uint16_t port, const String& prefilledUsername, String& username, String& password) override; + + void displayView() override; + bool canScrollView() override { return false; } + void scrollView(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollOffset) override; + bool isViewWindowActive() override; + bool isViewInWindow() override; + void enterAcceleratedCompositingMode(const LayerTreeContext&) override; + void exitAcceleratedCompositingMode() override; + void updateAcceleratedCompositingMode(const LayerTreeContext&) override; + void pageClosed() override { } + void preferencesDidChange() override { } + void startDrag(const WebCore::DragData&, PassRefPtr<ShareableBitmap> dragImage) override; + void setCursor(const WebCore::Cursor&) override; + void setCursorHiddenUntilMouseMoves(bool) override; + void toolTipChanged(const String&, const String&) override; // DefaultUndoController - virtual void registerEditCommand(PassRefPtr<WebEditCommandProxy>, WebPageProxy::UndoOrRedo); - virtual void clearAllEditCommands(); - virtual bool canUndoRedo(WebPageProxy::UndoOrRedo); - virtual void executeUndoRedo(WebPageProxy::UndoOrRedo); - - virtual WebCore::FloatRect convertToDeviceSpace(const WebCore::FloatRect&); - virtual WebCore::FloatRect convertToUserSpace(const WebCore::FloatRect&); - virtual WebCore::IntPoint screenToWindow(const WebCore::IntPoint&); - virtual WebCore::IntRect windowToScreen(const WebCore::IntRect&); - virtual void doneWithKeyEvent(const NativeWebKeyboardEvent&, bool wasEventHandled) { } - virtual PassRefPtr<WebPopupMenuProxy> createPopupMenuProxy(WebPageProxy*); - virtual PassRefPtr<WebContextMenuProxy> createContextMenuProxy(WebPageProxy*); + void registerEditCommand(PassRefPtr<WebEditCommandProxy>, WebPageProxy::UndoOrRedo) override; + void clearAllEditCommands() override; + bool canUndoRedo(WebPageProxy::UndoOrRedo) override; + void executeUndoRedo(WebPageProxy::UndoOrRedo) override; + + WebCore::FloatRect convertToDeviceSpace(const WebCore::FloatRect&) override; + WebCore::FloatRect convertToUserSpace(const WebCore::FloatRect&) override; + WebCore::IntPoint screenToRootView(const WebCore::IntPoint&) override; + WebCore::IntRect rootViewToScreen(const WebCore::IntRect&) override; + void doneWithKeyEvent(const NativeWebKeyboardEvent&, bool wasEventHandled) override { } + RefPtr<WebPopupMenuProxy> createPopupMenuProxy(WebPageProxy&) override; + std::unique_ptr<WebContextMenuProxy> createContextMenuProxy(WebPageProxy&, const ContextMenuContextData&, const UserData&) override; #if ENABLE(INPUT_TYPE_COLOR) - virtual PassRefPtr<WebColorPicker> createColorPicker(WebPageProxy*, const WebCore::Color& initialColor, const WebCore::IntRect&); + RefPtr<WebColorPicker> createColorPicker(WebPageProxy*, const WebCore::Color& initialColor, const WebCore::IntRect&) override; +#endif + void pageTransitionViewportReady() override; + void didFindZoomableArea(const WebCore::IntPoint&, const WebCore::IntRect&) override; + void updateTextInputState() override; + void handleWillSetInputMethodState() override; +#if ENABLE(QT_GESTURE_EVENTS) + void doneWithGestureEvent(const WebGestureEvent&, bool wasEventHandled) override; #endif - virtual void setFindIndicator(PassRefPtr<FindIndicator>, bool fadeOut, bool animate) { } - virtual void flashBackingStoreUpdates(const Vector<WebCore::IntRect>& updateRects); - virtual void pageTransitionViewportReady(); - virtual void didFindZoomableArea(const WebCore::IntPoint&, const WebCore::IntRect&); - virtual void updateTextInputState(); - virtual void handleWillSetInputMethodState(); - virtual void doneWithGestureEvent(const WebGestureEvent&, bool wasEventHandled); #if ENABLE(TOUCH_EVENTS) - virtual void doneWithTouchEvent(const NativeWebTouchEvent&, bool wasEventHandled); + void doneWithTouchEvent(const NativeWebTouchEvent&, bool wasEventHandled) override; +#endif + +#if ENABLE(FULLSCREEN_API) + WebFullScreenManagerProxyClient& fullScreenManagerProxyClient() final; + + // WebFullScreenManagerProxyClient + void closeFullScreenManager() final; + bool isFullScreen() final; + void enterFullScreen() final; + void exitFullScreen() final; + void beganEnterFullScreen(const WebCore::IntRect& initialFrame, const WebCore::IntRect& finalFrame) final; + void beganExitFullScreen(const WebCore::IntRect& initialFrame, const WebCore::IntRect& finalFrame) final; #endif private: QQuickWebView* m_webView; QtWebPageEventHandler* m_eventHandler; DefaultUndoController* m_undoController; + + // PageClient interface +public: + void requestScroll(const WebCore::FloatPoint& scrollPosition, const WebCore::IntPoint& scrollOrigin, bool isProgrammaticScroll) override; + void didCommitLoadForMainFrame(const WTF::String& mimeType, bool useCustomContentProvider) override; + void willEnterAcceleratedCompositingMode() override; + void didFinishLoadingDataForCustomContentProvider(const WTF::String& suggestedFilename, const IPC::DataReference&) override; + void navigationGestureDidBegin() override; + void navigationGestureWillEnd(bool willNavigate, WebBackForwardListItem&) override; + void navigationGestureDidEnd(bool willNavigate, WebBackForwardListItem&) override; + void navigationGestureDidEnd() override; + void willRecordNavigationSnapshot(WebBackForwardListItem&) override; + void didRemoveNavigationGestureSnapshot() override; + void didFirstVisuallyNonEmptyLayoutForMainFrame() override; + void didFinishLoadForMainFrame() override; + void didFailLoadForMainFrame() override; + void didSameDocumentNavigationForMainFrame(SameDocumentNavigationType) override; + void didChangeBackgroundColor() override; + void refView() override; + void derefView() override; +#if ENABLE(VIDEO) && USE(GSTREAMER) + bool decidePolicyForInstallMissingMediaPluginsPermissionRequest(InstallMissingMediaPluginsPermissionRequest&) override; +#endif + void didRestoreScrollPosition() override; }; } // namespace WebKit diff --git a/Source/WebKit2/UIProcess/qt/QtPinchGestureRecognizer.cpp b/Source/WebKit2/UIProcess/qt/QtPinchGestureRecognizer.cpp index 7fa58014f..a26c01062 100644 --- a/Source/WebKit2/UIProcess/qt/QtPinchGestureRecognizer.cpp +++ b/Source/WebKit2/UIProcess/qt/QtPinchGestureRecognizer.cpp @@ -103,4 +103,3 @@ void QtPinchGestureRecognizer::cancel() } } // namespace WebKit - diff --git a/Source/WebKit2/UIProcess/qt/QtTapGestureRecognizer.h b/Source/WebKit2/UIProcess/qt/QtTapGestureRecognizer.h index affbc38c5..a474b7536 100644 --- a/Source/WebKit2/UIProcess/qt/QtTapGestureRecognizer.h +++ b/Source/WebKit2/UIProcess/qt/QtTapGestureRecognizer.h @@ -35,7 +35,7 @@ namespace WebKit { class QtWebPageEventHandler; -class QtTapGestureRecognizer : public QObject, private QtGestureRecognizer { +class QtTapGestureRecognizer final : public QObject, private QtGestureRecognizer { public: QtTapGestureRecognizer(QtWebPageEventHandler*); void update(const QTouchEvent::TouchPoint&); @@ -43,7 +43,7 @@ public: void cancel(); protected: - void timerEvent(QTimerEvent*); + void timerEvent(QTimerEvent*) final; void highlightTimeout(); void singleTapTimeout(); void tapAndHoldTimeout(); diff --git a/Source/WebKit2/UIProcess/qt/QtWebContext.cpp b/Source/WebKit2/UIProcess/qt/QtWebContext.cpp index 6d80596dd..7030e13d9 100644 --- a/Source/WebKit2/UIProcess/qt/QtWebContext.cpp +++ b/Source/WebKit2/UIProcess/qt/QtWebContext.cpp @@ -31,6 +31,7 @@ #include <WKAPICast.h> #include <WKArray.h> #include <WKContextPrivate.h> +#include <WKData.h> #include <WKPage.h> #include <WKString.h> #include <WKStringQt.h> @@ -50,7 +51,7 @@ static void initInspectorServer() #if ENABLE(INSPECTOR_SERVER) QString inspectorEnv = QString::fromUtf8(qgetenv("QTWEBKIT_INSPECTOR_SERVER")); if (!inspectorEnv.isEmpty()) { - QString bindAddress = QLatin1String("127.0.0.1"); + QString bindAddress = QStringLiteral("127.0.0.1"); QString portStr = inspectorEnv; int port = 0; @@ -67,9 +68,9 @@ static void initInspectorServer() return; } - bool success = WebInspectorServer::shared().listen(bindAddress, port); + bool success = WebInspectorServer::singleton().listen(bindAddress, port); if (success) { - QString inspectorServerUrl = QString::fromLatin1("http://%1:%2").arg(bindAddress).arg(port); + QString inspectorServerUrl = QStringLiteral("http://%1:%2").arg(bindAddress).arg(port); qWarning("Inspector server started successfully. Try pointing a WebKit browser to %s", qPrintable(inspectorServerUrl)); } else qWarning("Couldn't start the inspector server on bind address \"%s\" and port \"%d\". In case of invalid input, try something like: \"12345\" or \"192.168.2.14:12345\" (with the address of one of this host's interface).", qPrintable(bindAddress), port); @@ -90,7 +91,7 @@ static void globalInitialization() static void didReceiveMessageFromInjectedBundle(WKContextRef, WKStringRef messageName, WKTypeRef messageBody, const void*) { if (!WKStringIsEqualToUTF8CString(messageName, "MessageFromNavigatorQtObject") -#ifdef HAVE_WEBCHANNEL +#if ENABLE(QT_WEBCHANNEL) && !WKStringIsEqualToUTF8CString(messageName, "MessageFromNavigatorQtWebChannelTransportObject") #endif ) @@ -104,26 +105,30 @@ static void didReceiveMessageFromInjectedBundle(WKContextRef, WKStringRef messag WKArrayRef body = static_cast<WKArrayRef>(messageBody); ASSERT(WKArrayGetSize(body) == 2); ASSERT(WKGetTypeID(WKArrayGetItemAtIndex(body, 0)) == WKPageGetTypeID()); - ASSERT(WKGetTypeID(WKArrayGetItemAtIndex(body, 1)) == WKStringGetTypeID()); WKPageRef page = static_cast<WKPageRef>(WKArrayGetItemAtIndex(body, 0)); - WKStringRef str = static_cast<WKStringRef>(WKArrayGetItemAtIndex(body, 1)); - if (WKStringIsEqualToUTF8CString(messageName, "MessageFromNavigatorQtObject")) - QQuickWebViewPrivate::get(page)->didReceiveMessageFromNavigatorQtObject(str); -#ifdef HAVE_WEBCHANNEL - else if (WKStringIsEqualToUTF8CString(messageName, "MessageFromNavigatorQtWebChannelTransportObject")) - QQuickWebViewPrivate::get(page)->didReceiveMessageFromNavigatorQtWebChannelTransportObject(str); + if (WKStringIsEqualToUTF8CString(messageName, "MessageFromNavigatorQtObject")) { + ASSERT(WKGetTypeID(WKArrayGetItemAtIndex(body, 1)) == WKStringGetTypeID()); + WKStringRef data = static_cast<WKStringRef>(WKArrayGetItemAtIndex(body, 1)); + QQuickWebViewPrivate::get(page)->didReceiveMessageFromNavigatorQtObject(data); + } +#if ENABLE(QT_WEBCHANNEL) + else if (WKStringIsEqualToUTF8CString(messageName, "MessageFromNavigatorQtWebChannelTransportObject")) { + ASSERT(WKGetTypeID(WKArrayGetItemAtIndex(body, 1)) == WKDataGetTypeID()); + WKDataRef data = static_cast<WKDataRef>(WKArrayGetItemAtIndex(body, 1)); + QQuickWebViewPrivate::get(page)->didReceiveMessageFromNavigatorQtWebChannelTransportObject(data); + } #endif } static void initializeContextInjectedBundleClient(WKContextRef context) { - WKContextInjectedBundleClient injectedBundleClient; - memset(&injectedBundleClient, 0, sizeof(WKContextInjectedBundleClient)); - injectedBundleClient.version = kWKContextInjectedBundleClientCurrentVersion; + WKContextInjectedBundleClientV0 injectedBundleClient; + memset(&injectedBundleClient, 0, sizeof(WKContextInjectedBundleClientV0)); + injectedBundleClient.base.version = 0; injectedBundleClient.didReceiveMessageFromInjectedBundle = didReceiveMessageFromInjectedBundle; - WKContextSetInjectedBundleClient(context, &injectedBundleClient); + WKContextSetInjectedBundleClient(context, &injectedBundleClient.base); } QtWebContext::QtWebContext(WKContextRef context) @@ -155,10 +160,11 @@ QtWebContext* QtWebContext::defaultContext() WKContextSetCacheModel(wkContext.get(), kWKCacheModelDocumentBrowser); // Those paths have to be set before the first web process is spawned. - WKContextSetDatabaseDirectory(wkContext.get(), adoptWK(WKStringCreateWithQString(preparedStoragePath(DatabaseStorage))).get()); - WKContextSetLocalStorageDirectory(wkContext.get(), adoptWK(WKStringCreateWithQString(preparedStoragePath(LocalStorage))).get()); +// QTFIXME +// WKContextSetDatabaseDirectory(wkContext.get(), adoptWK(WKStringCreateWithQString(preparedStoragePath(DatabaseStorage))).get()); +// WKContextSetLocalStorageDirectory(wkContext.get(), adoptWK(WKStringCreateWithQString(preparedStoragePath(LocalStorage))).get()); WKContextSetCookieStorageDirectory(wkContext.get(), adoptWK(WKStringCreateWithQString(preparedStoragePath(CookieStorage))).get()); - WKContextSetDiskCacheDirectory(wkContext.get(), adoptWK(WKStringCreateWithQString(preparedStoragePath(DiskCacheStorage))).get()); +// WKContextSetDiskCacheDirectory(wkContext.get(), adoptWK(WKStringCreateWithQString(preparedStoragePath(DiskCacheStorage))).get()); s_defaultQtWebContext = QtWebContext::create(wkContext.get()); } @@ -177,6 +183,10 @@ QString QtWebContext::preparedStoragePath(StorageType type) { QString path; switch (type) { + case ApplicationCacheStorage: + path = defaultLocation(QStandardPaths::DataLocation) % QStringLiteral("Applications"); + QDir::root().mkpath(path); + break; case DatabaseStorage: path = defaultLocation(QStandardPaths::DataLocation) % QStringLiteral("Databases"); QDir::root().mkpath(path); @@ -190,7 +200,11 @@ QString QtWebContext::preparedStoragePath(StorageType type) QDir::root().mkpath(path); break; case DiskCacheStorage: +#if ENABLE(NETWORK_CACHE) + path = defaultLocation(QStandardPaths::CacheLocation) % QStringLiteral("WebKitCache"); +#else path = defaultLocation(QStandardPaths::CacheLocation) % QStringLiteral("DiskCache"); +#endif QDir::root().mkpath(path); break; case IconDatabaseStorage: @@ -206,4 +220,3 @@ QString QtWebContext::preparedStoragePath(StorageType type) } } // namespace WebKit - diff --git a/Source/WebKit2/UIProcess/qt/QtWebContext.h b/Source/WebKit2/UIProcess/qt/QtWebContext.h index 4251f29e7..972e388a4 100644 --- a/Source/WebKit2/UIProcess/qt/QtWebContext.h +++ b/Source/WebKit2/UIProcess/qt/QtWebContext.h @@ -36,11 +36,13 @@ public: ~QtWebContext(); enum StorageType { + ApplicationCacheStorage, DatabaseStorage, LocalStorage, CookieStorage, DiskCacheStorage, - IconDatabaseStorage + IconDatabaseStorage, + NetworkCacheStorage }; static QtWebContext* create(WKContextRef); diff --git a/Source/WebKit2/UIProcess/qt/QtWebError.cpp b/Source/WebKit2/UIProcess/qt/QtWebError.cpp index c2f506c8f..940e2a510 100644 --- a/Source/WebKit2/UIProcess/qt/QtWebError.cpp +++ b/Source/WebKit2/UIProcess/qt/QtWebError.cpp @@ -21,6 +21,8 @@ #include "config.h" #include "QtWebError.h" +#include "WKErrorRef.h" + #include <QtCore/QUrl> #include <WKSharedAPICast.h> #include <WKString.h> diff --git a/Source/WebKit2/UIProcess/qt/QtWebError.h b/Source/WebKit2/UIProcess/qt/QtWebError.h index c2b922603..660aee855 100644 --- a/Source/WebKit2/UIProcess/qt/QtWebError.h +++ b/Source/WebKit2/UIProcess/qt/QtWebError.h @@ -22,8 +22,8 @@ #define QtWebError_h #include "qwebdownloaditem_p.h" +#include <APIError.h> #include <QtNetwork/QNetworkReply> -#include <WKError.h> #include <WKRetainPtr.h> QT_BEGIN_NAMESPACE diff --git a/Source/WebKit2/UIProcess/qt/QtWebIconDatabaseClient.cpp b/Source/WebKit2/UIProcess/qt/QtWebIconDatabaseClient.cpp index 86ac710bf..b641ab7f1 100644 --- a/Source/WebKit2/UIProcess/qt/QtWebIconDatabaseClient.cpp +++ b/Source/WebKit2/UIProcess/qt/QtWebIconDatabaseClient.cpp @@ -46,12 +46,12 @@ QtWebIconDatabaseClient::QtWebIconDatabaseClient(WKContextRef context) { m_iconDatabase = WKContextGetIconDatabase(context); - WKIconDatabaseClient iconDatabaseClient; - memset(&iconDatabaseClient, 0, sizeof(WKIconDatabaseClient)); - iconDatabaseClient.version = kWKIconDatabaseClientCurrentVersion; - iconDatabaseClient.clientInfo = this; + WKIconDatabaseClientV0 iconDatabaseClient; + memset(&iconDatabaseClient, 0, sizeof(WKIconDatabaseClientV0)); + iconDatabaseClient.base.version = 0; + iconDatabaseClient.base.clientInfo = this; iconDatabaseClient.didChangeIconForPageURL = didChangeIconForPageURL; - WKIconDatabaseSetIconDatabaseClient(m_iconDatabase, &iconDatabaseClient); + WKIconDatabaseSetIconDatabaseClient(m_iconDatabase, &iconDatabaseClient.base); // Triggers the startup of the icon database. WKRetainPtr<WKStringRef> path = adoptWK(WKStringCreateWithQString(QtWebContext::preparedStoragePath(QtWebContext::IconDatabaseStorage))); WKContextSetIconDatabasePath(context, path.get()); @@ -92,4 +92,3 @@ void QtWebIconDatabaseClient::releaseIconForPageURL(const QString& pageURL) } // namespace WebKit #include "moc_QtWebIconDatabaseClient.cpp" - diff --git a/Source/WebKit2/UIProcess/qt/QtWebIconDatabaseClient.h b/Source/WebKit2/UIProcess/qt/QtWebIconDatabaseClient.h index 69b7965ed..70fa5e12c 100644 --- a/Source/WebKit2/UIProcess/qt/QtWebIconDatabaseClient.h +++ b/Source/WebKit2/UIProcess/qt/QtWebIconDatabaseClient.h @@ -32,7 +32,7 @@ QT_END_NAMESPACE namespace WebKit { -class QtWebIconDatabaseClient : public QObject { +class QtWebIconDatabaseClient final : public QObject { Q_OBJECT public: diff --git a/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp b/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp index 8e7c5c221..d05649736 100644 --- a/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp +++ b/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp @@ -184,11 +184,11 @@ void QtWebPageEventHandler::handleHoverMoveEvent(QHoverEvent* ev) void QtWebPageEventHandler::handleDragEnterEvent(QDragEnterEvent* ev) { - m_webPageProxy->resetDragOperation(); + m_webPageProxy->resetCurrentDragInformation(); QTransform fromItemTransform = m_webPage->transformFromItem(); // FIXME: Should not use QCursor::pos() DragData dragData(ev->mimeData(), fromItemTransform.map(ev->pos()), QCursor::pos(), dropActionToDragOperation(ev->possibleActions())); - m_webPageProxy->dragEntered(&dragData); + m_webPageProxy->dragEntered(dragData); ev->acceptProposedAction(); } @@ -198,8 +198,8 @@ void QtWebPageEventHandler::handleDragLeaveEvent(QDragLeaveEvent* ev) // FIXME: Should not use QCursor::pos() DragData dragData(0, IntPoint(), QCursor::pos(), DragOperationNone); - m_webPageProxy->dragExited(&dragData); - m_webPageProxy->resetDragOperation(); + m_webPageProxy->dragExited(dragData); + m_webPageProxy->resetCurrentDragInformation(); ev->setAccepted(accepted); } @@ -211,9 +211,9 @@ void QtWebPageEventHandler::handleDragMoveEvent(QDragMoveEvent* ev) QTransform fromItemTransform = m_webPage->transformFromItem(); // FIXME: Should not use QCursor::pos() DragData dragData(ev->mimeData(), fromItemTransform.map(ev->pos()), QCursor::pos(), dropActionToDragOperation(ev->possibleActions())); - m_webPageProxy->dragUpdated(&dragData); - ev->setDropAction(dragOperationToDropAction(m_webPageProxy->dragSession().operation)); - if (m_webPageProxy->dragSession().operation != DragOperationNone) + m_webPageProxy->dragUpdated(dragData); + ev->setDropAction(dragOperationToDropAction(m_webPageProxy->currentDragOperation())); + if (m_webPageProxy->currentDragOperation() != DragOperationNone) ev->accept(); ev->setAccepted(accepted); @@ -227,8 +227,8 @@ void QtWebPageEventHandler::handleDropEvent(QDropEvent* ev) DragData dragData(ev->mimeData(), fromItemTransform.map(ev->pos()), QCursor::pos(), dropActionToDragOperation(ev->possibleActions())); SandboxExtension::Handle handle; SandboxExtension::HandleArray sandboxExtensionForUpload; - m_webPageProxy->performDrag(&dragData, String(), handle, sandboxExtensionForUpload); - ev->setDropAction(dragOperationToDropAction(m_webPageProxy->dragSession().operation)); + m_webPageProxy->performDragOperation(dragData, String(), handle, sandboxExtensionForUpload); + ev->setDropAction(dragOperationToDropAction(m_webPageProxy->currentDragOperation())); ev->accept(); ev->setAccepted(accepted); @@ -261,12 +261,14 @@ void QtWebPageEventHandler::deactivateTapHighlight() void QtWebPageEventHandler::handleSingleTapEvent(const QTouchEvent::TouchPoint& point) { +#if ENABLE(QT_GESTURE_EVENTS) deactivateTapHighlight(); m_postponeTextInputStateChanged = true; QTransform fromItemTransform = m_webPage->transformFromItem(); - WebGestureEvent gesture(WebEvent::GestureSingleTap, fromItemTransform.map(point.pos()).toPoint(), point.screenPos().toPoint(), WebEvent::Modifiers(0), 0, IntSize(point.rect().size().toSize()), FloatPoint(0, 0)); + WebGestureEvent gesture(WebEvent::GestureSingleTap, fromItemTransform.map(point.pos()).toPoint(), point.screenPos().toPoint(), WebEvent::Modifiers(0), 0, IntSize(point.rect().size().toSize())); m_webPageProxy->handleGestureEvent(gesture); +#endif } void QtWebPageEventHandler::handleDoubleTapEvent(const QTouchEvent::TouchPoint& point) @@ -300,12 +302,12 @@ void QtWebPageEventHandler::handleKeyReleaseEvent(QKeyEvent* ev) void QtWebPageEventHandler::handleFocusInEvent(QFocusEvent*) { - m_webPageProxy->viewStateDidChange(WebPageProxy::ViewIsFocused | WebPageProxy::ViewWindowIsActive); + m_webPageProxy->viewStateDidChange(ViewState::IsFocused | ViewState::WindowIsActive); } void QtWebPageEventHandler::handleFocusLost() { - m_webPageProxy->viewStateDidChange(WebPageProxy::ViewIsFocused | WebPageProxy::ViewWindowIsActive); + m_webPageProxy->viewStateDidChange(ViewState::IsFocused | ViewState::WindowIsActive); } void QtWebPageEventHandler::setViewportController(PageViewportControllerClientQt* controller) @@ -446,6 +448,7 @@ void QtWebPageEventHandler::handleWillSetInputMethodState() void QtWebPageEventHandler::doneWithGestureEvent(const WebGestureEvent& event, bool wasEventHandled) { +#if ENABLE(QT_GESTURE_EVENTS) if (event.type() != WebEvent::GestureSingleTap) return; @@ -455,6 +458,7 @@ void QtWebPageEventHandler::doneWithGestureEvent(const WebGestureEvent& event, b return; updateTextInputState(); +#endif } void QtWebPageEventHandler::handleInputEvent(const QInputEvent* event) @@ -562,7 +566,9 @@ void QtWebPageEventHandler::handleInputEvent(const QInputEvent* event) // Early return since this was a touch-end event. return; - } else if (activeTouchPointCount == 1) { + } + + if (activeTouchPointCount == 1) { // If the pinch gesture recognizer was previously in active state the content might // be out of valid zoom boundaries, thus we need to finish the pinch gesture here. // This will resume the content to valid zoom levels before the pan gesture is started. @@ -638,4 +644,3 @@ void QtWebPageEventHandler::startDrag(const WebCore::DragData& dragData, PassRef } // namespace WebKit #include "moc_QtWebPageEventHandler.cpp" - diff --git a/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.h b/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.h index 005cb4ca0..2fe82e8e0 100644 --- a/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.h +++ b/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.h @@ -51,7 +51,7 @@ class ShareableBitmap; class WebGestureEvent; class WebPageProxy; -class QtWebPageEventHandler : public QObject { +class QtWebPageEventHandler final : public QObject { Q_OBJECT public: @@ -84,7 +84,7 @@ public: void didFindZoomableArea(const WebCore::IntPoint& target, const WebCore::IntRect& area); void updateTextInputState(); - void doneWithGestureEvent(const WebGestureEvent& event, bool wasEventHandled); + void doneWithGestureEvent(const WebGestureEvent&, bool wasEventHandled); #if ENABLE(TOUCH_EVENTS) void doneWithTouchEvent(const NativeWebTouchEvent&, bool wasEventHandled); #endif @@ -109,7 +109,7 @@ private Q_SLOTS: void inputPanelVisibleChanged(); private: - void timerEvent(QTimerEvent*); + void timerEvent(QTimerEvent*) final; QPointF m_lastClick; QBasicTimer m_clickTimer; diff --git a/Source/WebKit2/UIProcess/qt/QtWebPagePolicyClient.cpp b/Source/WebKit2/UIProcess/qt/QtWebPagePolicyClient.cpp index 1f0ad1431..90e74fd9c 100644 --- a/Source/WebKit2/UIProcess/qt/QtWebPagePolicyClient.cpp +++ b/Source/WebKit2/UIProcess/qt/QtWebPagePolicyClient.cpp @@ -35,20 +35,19 @@ namespace WebKit { QtWebPagePolicyClient::QtWebPagePolicyClient(WKPageRef pageRef, QQuickWebView* webView) : m_webView(webView) { - WKPagePolicyClient policyClient; - memset(&policyClient, 0, sizeof(WKPagePolicyClient)); - policyClient.version = kWKPagePolicyClientCurrentVersion; - policyClient.clientInfo = this; + WKPagePolicyClientV1 policyClient; + memset(&policyClient, 0, sizeof(WKPagePolicyClientV0)); + policyClient.base = { 1, this }; policyClient.decidePolicyForNavigationAction = decidePolicyForNavigationAction; policyClient.decidePolicyForResponse = decidePolicyForResponse; - WKPageSetPagePolicyClient(pageRef, &policyClient); + WKPageSetPagePolicyClient(pageRef, &policyClient.base); } -void QtWebPagePolicyClient::decidePolicyForNavigationAction(const QUrl& url, Qt::MouseButton mouseButton, Qt::KeyboardModifiers keyboardModifiers, QQuickWebView::NavigationType navigationType, WKFramePolicyListenerRef listener) +void QtWebPagePolicyClient::decidePolicyForNavigationAction(const QUrl& url, Qt::MouseButton mouseButton, Qt::KeyboardModifiers keyboardModifiers, QQuickWebView::NavigationType navigationType, bool isMainFrame, WKFramePolicyListenerRef listener) { // NOTE: even though the C API (and the WebKit2 IPC) supports an asynchronous answer, this is not currently working. // We are expected to call the listener immediately. See the patch for https://bugs.webkit.org/show_bug.cgi?id=53785. - QWebNavigationRequest navigationRequest(url, mouseButton, keyboardModifiers, navigationType); + QWebNavigationRequest navigationRequest(url, mouseButton, keyboardModifiers, navigationType, isMainFrame); emit m_webView->navigationRequested(&navigationRequest); switch (navigationRequest.action()) { @@ -121,19 +120,19 @@ static QQuickWebView::NavigationType toQuickWebViewNavigationType(WKFrameNavigat return QQuickWebView::OtherNavigation; } -void QtWebPagePolicyClient::decidePolicyForNavigationAction(WKPageRef, WKFrameRef frame, WKFrameNavigationType navigationType, WKEventModifiers modifiers, WKEventMouseButton mouseButton, WKURLRequestRef request, WKFramePolicyListenerRef listener, WKTypeRef, const void* clientInfo) +void QtWebPagePolicyClient::decidePolicyForNavigationAction(WKPageRef page, WKFrameRef frame, WKFrameNavigationType navigationType, WKEventModifiers modifiers, WKEventMouseButton mouseButton, WKFrameRef originatingFrame, WKURLRequestRef request, WKFramePolicyListenerRef listener, WKTypeRef, const void* clientInfo) { WKRetainPtr<WKURLRef> frameURL(AdoptWK, WKFrameCopyURL(frame)); WKRetainPtr<WKURLRef> requestURL(AdoptWK, WKURLRequestCopyURL(request)); QUrl qUrl = WKURLCopyQUrl(requestURL.get()); - toQtWebPagePolicyClient(clientInfo)->decidePolicyForNavigationAction(qUrl, toQtMouseButton(mouseButton), toQtKeyboardModifiers(modifiers), toQuickWebViewNavigationType(navigationType), listener); + bool isMainFrame = (WKPageGetMainFrame(page) == frame); + toQtWebPagePolicyClient(clientInfo)->decidePolicyForNavigationAction(qUrl, toQtMouseButton(mouseButton), toQtKeyboardModifiers(modifiers), toQuickWebViewNavigationType(navigationType), isMainFrame, listener); } -void QtWebPagePolicyClient::decidePolicyForResponse(WKPageRef page, WKFrameRef frame, WKURLResponseRef response, WKURLRequestRef, WKFramePolicyListenerRef listener, WKTypeRef, const void*) +void QtWebPagePolicyClient::decidePolicyForResponse(WKPageRef page, WKFrameRef frame, WKURLResponseRef response, WKURLRequestRef, bool canShowMIMEType, WKFramePolicyListenerRef listener, WKTypeRef, const void*) { String type = toImpl(response)->resourceResponse().mimeType(); - type.makeLower(); - bool canShowMIMEType = toImpl(frame)->canShowMIMEType(type); + type.convertToASCIILowercase(); // QTFIXME: See also FrameLoaderClientQt if (WKPageGetMainFrame(page) == frame) { if (canShowMIMEType) { @@ -157,4 +156,3 @@ void QtWebPagePolicyClient::decidePolicyForResponse(WKPageRef page, WKFrameRef f } } // namespace WebKit - diff --git a/Source/WebKit2/UIProcess/qt/QtWebPagePolicyClient.h b/Source/WebKit2/UIProcess/qt/QtWebPagePolicyClient.h index 9515c020e..4e1d7f250 100644 --- a/Source/WebKit2/UIProcess/qt/QtWebPagePolicyClient.h +++ b/Source/WebKit2/UIProcess/qt/QtWebPagePolicyClient.h @@ -36,11 +36,11 @@ public: QtWebPagePolicyClient(WKPageRef, QQuickWebView*); private: - void decidePolicyForNavigationAction(const QUrl&, Qt::MouseButton, Qt::KeyboardModifiers, QQuickWebView::NavigationType, WKFramePolicyListenerRef); + void decidePolicyForNavigationAction(const QUrl&, Qt::MouseButton, Qt::KeyboardModifiers, QQuickWebView::NavigationType, bool isMainFrame, WKFramePolicyListenerRef); // WKPagePolicyClient callbacks. - static void decidePolicyForNavigationAction(WKPageRef, WKFrameRef, WKFrameNavigationType, WKEventModifiers, WKEventMouseButton, WKURLRequestRef, WKFramePolicyListenerRef, WKTypeRef userData, const void* clientInfo); - static void decidePolicyForResponse(WKPageRef, WKFrameRef, WKURLResponseRef, WKURLRequestRef, WKFramePolicyListenerRef, WKTypeRef userData, const void* clientInfo); + static void decidePolicyForNavigationAction(WKPageRef, WKFrameRef, WKFrameNavigationType, WKEventModifiers, WKEventMouseButton, WKFrameRef, WKURLRequestRef, WKFramePolicyListenerRef, WKTypeRef userData, const void* clientInfo); + static void decidePolicyForResponse(WKPageRef, WKFrameRef, WKURLResponseRef, WKURLRequestRef, bool, WKFramePolicyListenerRef, WKTypeRef userData, const void* clientInfo); QQuickWebView* m_webView; }; diff --git a/Source/WebKit2/UIProcess/qt/QtWebPageSGNode.cpp b/Source/WebKit2/UIProcess/qt/QtWebPageSGNode.cpp index 9a7b34951..6630f6276 100644 --- a/Source/WebKit2/UIProcess/qt/QtWebPageSGNode.cpp +++ b/Source/WebKit2/UIProcess/qt/QtWebPageSGNode.cpp @@ -21,11 +21,11 @@ #include "config.h" #include "QtWebPageSGNode.h" +#include "CoordinatedGraphicsScene.h" +#include "WebPageProxy.h" + #include <QtGui/QPolygonF> -#include <QtQuick/QQuickItem> -#include <QtQuick/QQuickWindow> #include <QtQuick/QSGSimpleRectNode> -#include <WebCore/CoordinatedGraphicsScene.h> #include <WebCore/TransformationMatrix.h> #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) @@ -38,7 +38,7 @@ using namespace WebCore; namespace WebKit { -class ContentsSGNode : public QSGRenderNode { +class ContentsSGNode final : public QSGRenderNode { public: ContentsSGNode(PassRefPtr<CoordinatedGraphicsScene> scene) : m_scene(scene) @@ -48,24 +48,24 @@ public: #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) - StateFlags changedStates() const override + StateFlags changedStates() const final { return StateFlags(StencilState) | ColorState | BlendState; } - void render(const RenderState* state) override + void render(const RenderState* state) final { renderInternal(state->projectionMatrix()); } #else - StateFlags changedStates() Q_DECL_OVERRIDE + StateFlags changedStates() final { return StateFlags(StencilState) | ColorState | BlendState; } - void render(const RenderState& state) Q_DECL_OVERRIDE + void render(const RenderState& state) final { renderInternal(state.projectionMatrix); } @@ -87,12 +87,14 @@ public: bool mirrored = projection && (*projection)(0, 0) * (*projection)(1, 1) - (*projection)(0, 1) * (*projection)(1, 0) > 0; // FIXME: Support non-rectangular clippings. - coordinatedGraphicsScene()->paintToCurrentGLContext(renderMatrix, inheritedOpacity(), clipRect(), mirrored ? TextureMapper::PaintingMirrored : 0); + coordinatedGraphicsScene()->paintToCurrentGLContext(renderMatrix, inheritedOpacity(), clipRect(), + pageNode()->page().pageExtendedBackgroundColor(), pageNode()->page().drawsBackground(), FloatPoint(), + mirrored ? TextureMapper::PaintingMirrored : 0); } void releaseResources() #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) - override + final #endif { coordinatedGraphicsScene()->purgeGLResources(); @@ -110,7 +112,7 @@ public: return parent; } - WebCore::CoordinatedGraphicsScene* coordinatedGraphicsScene() const { return m_scene.get(); } + CoordinatedGraphicsScene* coordinatedGraphicsScene() const { return m_scene.get(); } private: QRectF clipRect() const @@ -159,11 +161,12 @@ private: return resultRect; } - RefPtr<WebCore::CoordinatedGraphicsScene> m_scene; + RefPtr<CoordinatedGraphicsScene> m_scene; }; -QtWebPageSGNode::QtWebPageSGNode() - : m_contentsNode(0) +QtWebPageSGNode::QtWebPageSGNode(WebPageProxy& page) + : m_page(page) + , m_contentsNode(0) , m_backgroundNode(new QSGSimpleRectNode) , m_devicePixelRatio(1) { @@ -183,7 +186,7 @@ void QtWebPageSGNode::setScale(float scale) setMatrix(matrix); } -void QtWebPageSGNode::setCoordinatedGraphicsScene(PassRefPtr<WebCore::CoordinatedGraphicsScene> scene) +void QtWebPageSGNode::setCoordinatedGraphicsScene(PassRefPtr<CoordinatedGraphicsScene> scene) { if (m_contentsNode && m_contentsNode->coordinatedGraphicsScene() == scene) return; diff --git a/Source/WebKit2/UIProcess/qt/QtWebPageSGNode.h b/Source/WebKit2/UIProcess/qt/QtWebPageSGNode.h index 77ad81b6f..49c4c5000 100644 --- a/Source/WebKit2/UIProcess/qt/QtWebPageSGNode.h +++ b/Source/WebKit2/UIProcess/qt/QtWebPageSGNode.h @@ -29,24 +29,24 @@ class QQuickItem; class QSGSimpleRectNode; QT_END_NAMESPACE -namespace WebCore { -class CoordinatedGraphicsScene; -} - namespace WebKit { class ContentsSGNode; +class CoordinatedGraphicsScene; +class WebPageProxy; -class QtWebPageSGNode : public QSGTransformNode { +class QtWebPageSGNode final : public QSGTransformNode { public: - QtWebPageSGNode(); + QtWebPageSGNode(WebPageProxy&); void setBackground(const QRectF&, const QColor&); void setScale(float); - void setCoordinatedGraphicsScene(PassRefPtr<WebCore::CoordinatedGraphicsScene>); + void setCoordinatedGraphicsScene(PassRefPtr<CoordinatedGraphicsScene>); qreal devicePixelRatio() const { return m_devicePixelRatio; } void setDevicePixelRatio(qreal devicePixelRatio) { m_devicePixelRatio = devicePixelRatio; } + const WebPageProxy& page() const { return m_page; } private: + Ref<WebPageProxy> m_page; ContentsSGNode* m_contentsNode; QSGSimpleRectNode* m_backgroundNode; qreal m_devicePixelRatio; diff --git a/Source/WebKit2/UIProcess/qt/QtWebPageUIClient.cpp b/Source/WebKit2/UIProcess/qt/QtWebPageUIClient.cpp index af88423c6..c58f20065 100644 --- a/Source/WebKit2/UIProcess/qt/QtWebPageUIClient.cpp +++ b/Source/WebKit2/UIProcess/qt/QtWebPageUIClient.cpp @@ -37,10 +37,10 @@ namespace WebKit { QtWebPageUIClient::QtWebPageUIClient(WKPageRef pageRef, QQuickWebView* webView) : m_webView(webView) { - WKPageUIClient uiClient; - memset(&uiClient, 0, sizeof(WKPageUIClient)); - uiClient.version = kWKPageUIClientCurrentVersion; - uiClient.clientInfo = this; + WKPageUIClientV1 uiClient; + memset(&uiClient, 0, sizeof(WKPageUIClientV1)); + uiClient.base.version = 1; + uiClient.base.clientInfo = this; uiClient.runJavaScriptAlert = runJavaScriptAlert; uiClient.runJavaScriptConfirm = runJavaScriptConfirm; uiClient.runJavaScriptPrompt = runJavaScriptPrompt; @@ -49,7 +49,7 @@ QtWebPageUIClient::QtWebPageUIClient(WKPageRef pageRef, QQuickWebView* webView) uiClient.exceededDatabaseQuota = exceededDatabaseQuota; uiClient.decidePolicyForGeolocationPermissionRequest = policyForGeolocationPermissionRequest; uiClient.decidePolicyForNotificationPermissionRequest = policyForNotificationPermissionRequest; - WKPageSetPageUIClient(pageRef, &uiClient); + WKPageSetPageUIClient(pageRef, &uiClient.base); } quint64 QtWebPageUIClient::exceededDatabaseQuota(const QString& databaseName, const QString& displayName, WKSecurityOriginRef securityOrigin, quint64 currentQuota, quint64 currentOriginUsage, quint64 currentDatabaseUsage, quint64 expectedUsage) @@ -119,8 +119,8 @@ bool QtWebPageUIClient::runJavaScriptConfirm(WKPageRef, WKStringRef message, WKF static inline WKStringRef createNullWKString() { - RefPtr<WebString> webString = WebString::createNull(); - return toAPI(webString.release().leakRef()); + RefPtr<API::String> apiString = API::String::createNull(); + return toAPI(apiString.release().leakRef()); } WKStringRef QtWebPageUIClient::runJavaScriptPrompt(WKPageRef, WKStringRef message, WKStringRef defaultValue, WKFrameRef, const void* clientInfo) @@ -174,4 +174,3 @@ void QtWebPageUIClient::policyForNotificationPermissionRequest(WKPageRef page, W } } // namespace WebKit - diff --git a/Source/WebKit2/UIProcess/qt/QtWebPageUIClient.h b/Source/WebKit2/UIProcess/qt/QtWebPageUIClient.h index e8aaa826b..b608d5880 100644 --- a/Source/WebKit2/UIProcess/qt/QtWebPageUIClient.h +++ b/Source/WebKit2/UIProcess/qt/QtWebPageUIClient.h @@ -26,7 +26,7 @@ #include <WKFrame.h> #include <WKGeolocationPermissionRequest.h> #include <WKPage.h> -#include <WKSecurityOrigin.h> +#include <WKSecurityOriginRef.h> class QQuickWebView; class QWebPermissionRequest; diff --git a/Source/WebKit2/UIProcess/qt/TextCheckerQt.cpp b/Source/WebKit2/UIProcess/qt/TextCheckerQt.cpp index 7e343e179..4880ac119 100644 --- a/Source/WebKit2/UIProcess/qt/TextCheckerQt.cpp +++ b/Source/WebKit2/UIProcess/qt/TextCheckerQt.cpp @@ -80,12 +80,12 @@ void TextChecker::closeSpellDocumentWithTag(int64_t) notImplemented(); } -void TextChecker::checkSpellingOfString(int64_t, const UChar*, uint32_t, int32_t&, int32_t&) +void TextChecker::checkSpellingOfString(int64_t, StringView, int32_t&, int32_t&) { notImplemented(); } -void TextChecker::checkGrammarOfString(int64_t, const UChar*, uint32_t, Vector<WebCore::GrammarDetail>&, int32_t&, int32_t&) +void TextChecker::checkGrammarOfString(int64_t, StringView, Vector<WebCore::GrammarDetail>&, int32_t&, int32_t&) { notImplemented(); } diff --git a/Source/WebKit2/UIProcess/qt/WebColorPickerQt.cpp b/Source/WebKit2/UIProcess/qt/WebColorPickerQt.cpp index 5fe35d771..031c32d9e 100644 --- a/Source/WebKit2/UIProcess/qt/WebColorPickerQt.cpp +++ b/Source/WebKit2/UIProcess/qt/WebColorPickerQt.cpp @@ -82,19 +82,19 @@ void WebColorPickerQt::createItem(QObject* contextObject) createContext(component, contextObject); QObject* object = component->beginCreate(m_context.get()); if (!object) { - m_context.clear(); + m_context = nullptr; return; } - m_colorChooser = adoptPtr(qobject_cast<QQuickItem*>(object)); + m_colorChooser.reset(qobject_cast<QQuickItem*>(object)); if (!m_colorChooser) { - m_context.clear(); + m_context = nullptr; return; } // Needs to be enqueue because it might trigger deletion. connect(contextObject, SIGNAL(accepted(QColor)), SLOT(notifyColorSelected(QColor)), Qt::QueuedConnection); - connect(contextObject, SIGNAL(rejected()), SLOT(endChooser()), Qt::QueuedConnection); + connect(contextObject, SIGNAL(rejected()), SLOT(endPicker()), Qt::QueuedConnection); QQuickWebViewPrivate::get(m_webView)->addAttachedPropertyTo(m_colorChooser.get()); m_colorChooser->setParentItem(m_webView); @@ -107,10 +107,10 @@ void WebColorPickerQt::createContext(QQmlComponent* component, QObject* contextO QQmlContext* baseContext = component->creationContext(); if (!baseContext) baseContext = QQmlEngine::contextForObject(m_webView); - m_context = adoptPtr(new QQmlContext(baseContext)); + m_context.reset(new QQmlContext(baseContext)); contextObject->setParent(m_context.get()); - m_context->setContextProperty(QLatin1String("model"), contextObject); + m_context->setContextProperty(QStringLiteral("model"), contextObject); m_context->setContextObject(contextObject); } @@ -123,6 +123,12 @@ void WebColorPickerQt::setSelectedColor(const Color&) // And yes, the name sounds misleading but comes from WebCore. } +void WebColorPickerQt::showColorPicker(const Color&) +{ + // We use ENABLE(INPUT_TYPE_COLOR_POPOVER), so new color picker is created + // each time +} + void WebColorPickerQt::notifyColorSelected(const QColor& color) { if (!m_client) @@ -132,18 +138,13 @@ void WebColorPickerQt::notifyColorSelected(const QColor& color) Color coreColor = makeRGB(color.red(), color.green(), color.blue()); m_client->didChooseColor(coreColor); - endChooser(); + endPicker(); } -void WebColorPickerQt::endChooser() +void WebColorPickerQt::endPicker() { - m_colorChooser.clear(); - m_context.clear(); - - if (!m_client) - return; - - m_client->didEndColorChooser(); + m_colorChooser = nullptr; + m_context = nullptr; } } // namespace WebKit diff --git a/Source/WebKit2/UIProcess/qt/WebColorPickerQt.h b/Source/WebKit2/UIProcess/qt/WebColorPickerQt.h index 01c5bf97d..0d57f7d3d 100644 --- a/Source/WebKit2/UIProcess/qt/WebColorPickerQt.h +++ b/Source/WebKit2/UIProcess/qt/WebColorPickerQt.h @@ -24,7 +24,6 @@ #include "IntRect.h" #include "WebColorPicker.h" #include <QtCore/QObject> -#include <wtf/OwnPtr.h> QT_BEGIN_NAMESPACE class QQmlComponent; @@ -40,7 +39,7 @@ class Color; namespace WebKit { -class WebColorPickerQt : public QObject, public WebColorPicker { +class WebColorPickerQt final : public QObject, public WebColorPicker { Q_OBJECT public: @@ -50,10 +49,11 @@ public: } ~WebColorPickerQt(); - virtual void setSelectedColor(const WebCore::Color&); + void setSelectedColor(const WebCore::Color&) final; + void showColorPicker(const WebCore::Color&) final; public Q_SLOTS: - virtual void endChooser(); + void endPicker() final; private Q_SLOTS: void notifyColorSelected(const QColor&); @@ -64,8 +64,8 @@ private: void createItem(QObject*); void createContext(QQmlComponent*, QObject*); - OwnPtr<QQmlContext> m_context; - OwnPtr<QQuickItem> m_colorChooser; + std::unique_ptr<QQmlContext> m_context; + std::unique_ptr<QQuickItem> m_colorChooser; QQuickWebView* m_webView; }; diff --git a/Source/WebKit2/UIProcess/qt/WebContextMenuProxyQt.cpp b/Source/WebKit2/UIProcess/qt/WebContextMenuProxyQt.cpp index d510c53ff..b0eea135a 100644 --- a/Source/WebKit2/UIProcess/qt/WebContextMenuProxyQt.cpp +++ b/Source/WebKit2/UIProcess/qt/WebContextMenuProxyQt.cpp @@ -31,24 +31,15 @@ using namespace WebCore; namespace WebKit { -WebContextMenuProxyQt::WebContextMenuProxyQt(WebPageProxy*) +WebContextMenuProxyQt::WebContextMenuProxyQt(const ContextMenuContextData& context, const UserData& userData) + : WebContextMenuProxy(context, userData) { } -PassRefPtr<WebContextMenuProxyQt> WebContextMenuProxyQt::create(WebPageProxy* webPageProxy) -{ - return adoptRef(new WebContextMenuProxyQt(webPageProxy)); -} - -void WebContextMenuProxyQt::showContextMenu(const IntPoint& position, const Vector<WebContextMenuItemData>& items) -{ -} - -void WebContextMenuProxyQt::hideContextMenu() +void WebContextMenuProxyQt::show() { } #include "moc_WebContextMenuProxyQt.cpp" } // namespace WebKit - diff --git a/Source/WebKit2/UIProcess/qt/WebContextMenuProxyQt.h b/Source/WebKit2/UIProcess/qt/WebContextMenuProxyQt.h index bd7aebd6f..9a8645aa3 100644 --- a/Source/WebKit2/UIProcess/qt/WebContextMenuProxyQt.h +++ b/Source/WebKit2/UIProcess/qt/WebContextMenuProxyQt.h @@ -37,13 +37,10 @@ class WebPageProxy; class WebContextMenuProxyQt : public QObject, public WebContextMenuProxy { Q_OBJECT public: - static PassRefPtr<WebContextMenuProxyQt> create(WebPageProxy*); + WebContextMenuProxyQt(const ContextMenuContextData&, const UserData&); private: - WebContextMenuProxyQt(WebPageProxy*); - - virtual void showContextMenu(const WebCore::IntPoint&, const Vector<WebContextMenuItemData>&); - virtual void hideContextMenu(); + void show() override; }; } // namespace WebKit diff --git a/Source/WebKit2/UIProcess/qt/WebGeolocationProviderQt.cpp b/Source/WebKit2/UIProcess/qt/WebGeolocationProviderQt.cpp index 7d05f043e..ca9cae747 100644 --- a/Source/WebKit2/UIProcess/qt/WebGeolocationProviderQt.cpp +++ b/Source/WebKit2/UIProcess/qt/WebGeolocationProviderQt.cpp @@ -46,16 +46,16 @@ WebGeolocationProviderQt* WebGeolocationProviderQt::create(WKGeolocationManagerR return new WebGeolocationProviderQt(manager); } -WKGeolocationProvider* WebGeolocationProviderQt::provider(const WebGeolocationProviderQt* location) +WKGeolocationProviderBase* WebGeolocationProviderQt::provider(const WebGeolocationProviderQt* location) { - static WKGeolocationProvider provider = { - 0, // This features the version. - location, // This points to the object implementer. + static WKGeolocationProviderV0 provider = { + { 0, // This features the version. + location }, // This points to the object implementer. locationStartUpdating, // The callbacks are next. locationStopUpdating }; - return &provider; + return &provider.base; } WebGeolocationProviderQt::WebGeolocationProviderQt(WKGeolocationManagerRef manager) diff --git a/Source/WebKit2/UIProcess/qt/WebGeolocationProviderQt.h b/Source/WebKit2/UIProcess/qt/WebGeolocationProviderQt.h index e476b128d..035eff0cd 100644 --- a/Source/WebKit2/UIProcess/qt/WebGeolocationProviderQt.h +++ b/Source/WebKit2/UIProcess/qt/WebGeolocationProviderQt.h @@ -22,9 +22,9 @@ #define WebGeolocationProviderQt_h #include <QObject> -#include <WebKit2/WKGeolocationManager.h> -#include <WebKit2/WKGeolocationPosition.h> -#include <WebKit2/WKRetainPtr.h> +#include <WebKit/WKGeolocationManager.h> +#include <WebKit/WKGeolocationPosition.h> +#include <WebKit/WKRetainPtr.h> QT_BEGIN_NAMESPACE class QGeoPositionInfoSource; @@ -33,11 +33,11 @@ QT_END_NAMESPACE namespace WebKit { -class WebGeolocationProviderQt : public QObject { +class WebGeolocationProviderQt final : public QObject { Q_OBJECT public: static WebGeolocationProviderQt* create(WKGeolocationManagerRef); - static WKGeolocationProvider* provider(const WebGeolocationProviderQt*); + static WKGeolocationProviderBase* provider(const WebGeolocationProviderQt*); virtual ~WebGeolocationProviderQt(); diff --git a/Source/WebKit2/UIProcess/qt/WebInspectorProxyQt.cpp b/Source/WebKit2/UIProcess/qt/WebInspectorProxyQt.cpp index b9058478d..2de52d2c4 100644 --- a/Source/WebKit2/UIProcess/qt/WebInspectorProxyQt.cpp +++ b/Source/WebKit2/UIProcess/qt/WebInspectorProxyQt.cpp @@ -26,8 +26,6 @@ #include "config.h" #include "WebInspectorProxy.h" -#if ENABLE(INSPECTOR) - #include <WebCore/NotImplemented.h> #include <wtf/text/WTFString.h> @@ -49,6 +47,11 @@ void WebInspectorProxy::platformDidClose() notImplemented(); } +void WebKit::WebInspectorProxy::platformInvalidate() +{ + notImplemented(); +} + void WebInspectorProxy::platformHide() { notImplemented(); @@ -107,12 +110,12 @@ void WebInspectorProxy::platformSetAttachedWindowWidth(unsigned) notImplemented(); } -void WebInspectorProxy::platformSetToolbarHeight(unsigned) +void WebKit::WebInspectorProxy::platformStartWindowDrag() { notImplemented(); } -void WebInspectorProxy::platformSave(const String&, const String&, bool) +void WebInspectorProxy::platformSave(const String&, const String&, bool, bool) { notImplemented(); } @@ -122,18 +125,22 @@ void WebInspectorProxy::platformAppend(const String&, const String&) notImplemented(); } -String WebInspectorProxy::inspectorPageURL() const +String WebInspectorProxy::inspectorPageURL() { notImplemented(); return String(); } -String WebInspectorProxy::inspectorBaseURL() const +String WebInspectorProxy::inspectorTestPageURL() { notImplemented(); return String(); } -} // namespace WebKit +String WebInspectorProxy::inspectorBaseURL() +{ + notImplemented(); + return String(); +} -#endif // ENABLE(INSPECTOR) +} // namespace WebKit diff --git a/Source/WebKit2/UIProcess/qt/WebPageProxyQt.cpp b/Source/WebKit2/UIProcess/qt/WebPageProxyQt.cpp index a89782506..d3eeb5962 100644 --- a/Source/WebKit2/UIProcess/qt/WebPageProxyQt.cpp +++ b/Source/WebKit2/UIProcess/qt/WebPageProxyQt.cpp @@ -32,6 +32,7 @@ #include "WebKitVersion.h" #include "WebPageMessages.h" #include "WebProcessProxy.h" +#include "WebsiteDataStore.h" #include <WebCore/Editor.h> #include <WebCore/NotImplemented.h> @@ -45,60 +46,52 @@ using namespace WebCore; namespace WebKit { +void WebPageProxy::platformInitialize() +{ +} + String WebPageProxy::standardUserAgent(const String& applicationNameForUserAgent) { return UserAgentQt::standardUserAgent(applicationNameForUserAgent, WEBKIT_MAJOR_VERSION, WEBKIT_MINOR_VERSION); } -void WebPageProxy::saveRecentSearches(const String&, const Vector<String>&) +void WebPageProxy::saveRecentSearches(const String&, const Vector<WebCore::RecentSearch>&) { notImplemented(); } -void WebPageProxy::loadRecentSearches(const String&, Vector<String>&) +void WebPageProxy::loadRecentSearches(const String&, Vector<WebCore::RecentSearch>&) { notImplemented(); } -void WebPageProxy::registerApplicationScheme(const String& scheme) +void WebsiteDataStore::platformRemoveRecentSearches(std::chrono::system_clock::time_point oldestTimeToRemove) { - process()->send(Messages::WebPage::RegisterApplicationScheme(scheme), m_pageID); + notImplemented(); } -void WebPageProxy::resolveApplicationSchemeRequest(QtNetworkRequestData request) +void WebPageProxy::editorStateChanged(const EditorState& editorState) { -#if HAVE(QTQUICK) - RefPtr<QtRefCountedNetworkRequestData> requestData = adoptRef(new QtRefCountedNetworkRequestData(request)); - m_applicationSchemeRequests.add(requestData); - static_cast<QtPageClient*>(m_pageClient)->handleApplicationSchemeRequest(requestData); -#endif -} + m_editorState = editorState; -void WebPageProxy::sendApplicationSchemeReply(const QQuickNetworkReply* reply) -{ -#if HAVE(QTQUICK) - RefPtr<QtRefCountedNetworkRequestData> requestData = reply->networkRequestData(); - if (m_applicationSchemeRequests.contains(requestData)) { - RefPtr<QtRefCountedNetworkReplyData> replyData = reply->networkReplyData(); - process()->send(Messages::WebPage::ApplicationSchemeReply(replyData->data()), pageID()); - m_applicationSchemeRequests.remove(requestData); - } -#endif + if (editorState.shouldIgnoreCompositionSelectionChange) + return; + m_pageClient.updateTextInputState(); } void WebPageProxy::authenticationRequiredRequest(const String& hostname, const String& realm, const String& prefilledUsername, String& username, String& password) { - m_pageClient->handleAuthenticationRequiredRequest(hostname, realm, prefilledUsername, username, password); + m_pageClient.handleAuthenticationRequiredRequest(hostname, realm, prefilledUsername, username, password); } void WebPageProxy::proxyAuthenticationRequiredRequest(const String& hostname, uint16_t port, const String& prefilledUsername, String& username, String& password) { - m_pageClient->handleProxyAuthenticationRequiredRequest(hostname, port, prefilledUsername, username, password); + m_pageClient.handleProxyAuthenticationRequiredRequest(hostname, port, prefilledUsername, username, password); } void WebPageProxy::certificateVerificationRequest(const String& hostname, bool& ignoreErrors) { - m_pageClient->handleCertificateVerificationRequest(hostname, ignoreErrors); + m_pageClient.handleCertificateVerificationRequest(hostname, ignoreErrors); } #if PLUGIN_ARCHITECTURE(X11) @@ -111,21 +104,26 @@ void WebPageProxy::windowedPluginGeometryDidChange(const WebCore::IntRect& frame { notImplemented(); } + +void WebPageProxy::windowedPluginVisibilityDidChange(bool isVisible, uint64_t windowID) +{ + notImplemented(); +} #endif void WebPageProxy::changeSelectedIndex(int32_t selectedIndex) { - process()->send(Messages::WebPage::SelectedIndex(selectedIndex), m_pageID); + process().send(Messages::WebPage::SelectedIndex(selectedIndex), m_pageID); } void WebPageProxy::closePopupMenu() { - process()->send(Messages::WebPage::HidePopupMenu(), m_pageID); + process().send(Messages::WebPage::HidePopupMenu(), m_pageID); } void WebPageProxy::willSetInputMethodState() { - m_pageClient->handleWillSetInputMethodState(); + m_pageClient.handleWillSetInputMethodState(); } } // namespace WebKit diff --git a/Source/WebKit2/UIProcess/qt/WebPopupMenuProxyQt.cpp b/Source/WebKit2/UIProcess/qt/WebPopupMenuProxyQt.cpp index 01ea5e6bd..249de62ec 100644 --- a/Source/WebKit2/UIProcess/qt/WebPopupMenuProxyQt.cpp +++ b/Source/WebKit2/UIProcess/qt/WebPopupMenuProxyQt.cpp @@ -41,7 +41,7 @@ namespace WebKit { static QHash<int, QByteArray> createRoleNamesHash(); -class PopupMenuItemModel : public QAbstractListModel { +class PopupMenuItemModel final : public QAbstractListModel { Q_OBJECT public: @@ -53,9 +53,9 @@ public: }; PopupMenuItemModel(const Vector<WebPopupItem>&, bool multiple); - virtual int rowCount(const QModelIndex& parent = QModelIndex()) const { return m_items.size(); } - virtual QVariant data(const QModelIndex&, int role = Qt::DisplayRole) const; - virtual QHash<int, QByteArray> roleNames() const; + int rowCount(const QModelIndex& parent = QModelIndex()) const final { return m_items.size(); } + QVariant data(const QModelIndex&, int role = Qt::DisplayRole) const final; + QHash<int, QByteArray> roleNames() const final; Q_INVOKABLE void select(int); @@ -250,7 +250,7 @@ void PopupMenuItemModel::buildItems(const Vector<WebPopupItem>& webPopupItems) { QString currentGroup; m_items.reserveInitialCapacity(webPopupItems.size()); - for (size_t i = 0; i < webPopupItems.size(); i++) { + for (int i = 0; i < webPopupItems.size(); i++) { const WebPopupItem& webPopupItem = webPopupItems[i]; if (webPopupItem.m_isLabel) { currentGroup = webPopupItem.m_text; @@ -262,7 +262,7 @@ void PopupMenuItemModel::buildItems(const Vector<WebPopupItem>& webPopupItems) } } -WebPopupMenuProxyQt::WebPopupMenuProxyQt(WebPopupMenuProxy::Client* client, QQuickWebView* webView) +WebPopupMenuProxyQt::WebPopupMenuProxyQt(WebPopupMenuProxy::Client& client, QQuickWebView* webView) : WebPopupMenuProxy(client) , m_webView(webView) { @@ -287,8 +287,8 @@ void WebPopupMenuProxyQt::showPopupMenu(const IntRect& rect, WebCore::TextDirect void WebPopupMenuProxyQt::hidePopupMenu() { - m_itemSelector.clear(); - m_context.clear(); + m_itemSelector = nullptr; + m_context = nullptr; if (m_client) { m_client->closePopupMenu(); @@ -314,7 +314,7 @@ void WebPopupMenuProxyQt::createItem(QObject* contextObject) if (!object) return; - m_itemSelector = adoptPtr(qobject_cast<QQuickItem*>(object)); + m_itemSelector.reset(qobject_cast<QQuickItem*>(object)); if (!m_itemSelector) return; @@ -339,10 +339,10 @@ void WebPopupMenuProxyQt::createContext(QQmlComponent* component, QObject* conte QQmlContext* baseContext = component->creationContext(); if (!baseContext) baseContext = QQmlEngine::contextForObject(m_webView); - m_context = adoptPtr(new QQmlContext(baseContext)); + m_context.reset(new QQmlContext(baseContext)); contextObject->setParent(m_context.get()); - m_context->setContextProperty(QLatin1String("model"), contextObject); + m_context->setContextProperty(QStringLiteral("model"), contextObject); m_context->setContextObject(contextObject); } diff --git a/Source/WebKit2/UIProcess/qt/WebPopupMenuProxyQt.h b/Source/WebKit2/UIProcess/qt/WebPopupMenuProxyQt.h index e622f9006..2475ba970 100644 --- a/Source/WebKit2/UIProcess/qt/WebPopupMenuProxyQt.h +++ b/Source/WebKit2/UIProcess/qt/WebPopupMenuProxyQt.h @@ -29,7 +29,6 @@ #include "WebPopupMenuProxy.h" #include <QtCore/QObject> -#include <wtf/OwnPtr.h> QT_BEGIN_NAMESPACE class QQmlComponent; @@ -41,7 +40,7 @@ class QQuickWebView; namespace WebKit { -class WebPopupMenuProxyQt : public QObject, public WebPopupMenuProxy { +class WebPopupMenuProxyQt final : public QObject, public WebPopupMenuProxy { Q_OBJECT public: @@ -50,27 +49,27 @@ public: MultipleSelection }; - static PassRefPtr<WebPopupMenuProxyQt> create(WebPopupMenuProxy::Client* client, QQuickWebView* webView) + static Ref<WebPopupMenuProxyQt> create(WebPopupMenuProxy::Client& client, QQuickWebView* webView) { - return adoptRef(new WebPopupMenuProxyQt(client, webView)); + return adoptRef(*new WebPopupMenuProxyQt(client, webView)); } ~WebPopupMenuProxyQt(); - virtual void showPopupMenu(const WebCore::IntRect&, WebCore::TextDirection, double pageScaleFactor, const Vector<WebPopupItem>&, const PlatformPopupMenuData&, int32_t selectedIndex); + void showPopupMenu(const WebCore::IntRect&, WebCore::TextDirection, double pageScaleFactor, const Vector<WebPopupItem>&, const PlatformPopupMenuData&, int32_t selectedIndex) final; public Q_SLOTS: - virtual void hidePopupMenu(); + void hidePopupMenu() final; private Q_SLOTS: void selectIndex(int); private: - WebPopupMenuProxyQt(WebPopupMenuProxy::Client*, QQuickWebView*); + WebPopupMenuProxyQt(WebPopupMenuProxy::Client&, QQuickWebView*); void createItem(QObject*); void createContext(QQmlComponent*, QObject*); - OwnPtr<QQmlContext> m_context; - OwnPtr<QQuickItem> m_itemSelector; + std::unique_ptr<QQmlContext> m_context; + std::unique_ptr<QQuickItem> m_itemSelector; QQuickWebView* m_webView; SelectionType m_selectionType; diff --git a/Source/WebKit2/UIProcess/qt/WebPreferencesQt.cpp b/Source/WebKit2/UIProcess/qt/WebPreferencesQt.cpp index 35dc7ebb9..6072394cb 100644 --- a/Source/WebKit2/UIProcess/qt/WebPreferencesQt.cpp +++ b/Source/WebKit2/UIProcess/qt/WebPreferencesQt.cpp @@ -25,7 +25,10 @@ #include "config.h" #include "WebPreferences.h" + +#include "WebPreferencesKeys.h" #include <QFont> +#include <WebCore/NotImplemented.h> namespace WebKit { @@ -62,22 +65,51 @@ void WebPreferences::platformInitializeStore() void WebPreferences::platformUpdateStringValueForKey(const String&, const String&) { + notImplemented(); } void WebPreferences::platformUpdateBoolValueForKey(const String&, bool) { + notImplemented(); } void WebPreferences::platformUpdateUInt32ValueForKey(const String&, uint32_t) { + notImplemented(); } void WebPreferences::platformUpdateDoubleValueForKey(const String&, double) { + notImplemented(); } void WebPreferences::platformUpdateFloatValueForKey(const String&, float) { + notImplemented(); +} + +bool WebPreferences::platformGetStringUserValueForKey(const String&, String&) +{ + notImplemented(); + return false; +} + +bool WebPreferences::platformGetBoolUserValueForKey(const String&, bool&) +{ + notImplemented(); + return false; +} + +bool WebPreferences::platformGetUInt32UserValueForKey(const String&, uint32_t&) +{ + notImplemented(); + return false; +} + +bool WebPreferences::platformGetDoubleUserValueForKey(const String&, double&) +{ + notImplemented(); + return false; } } // namespace WebKit diff --git a/Source/WebKit2/UIProcess/qt/WebContextQt.cpp b/Source/WebKit2/UIProcess/qt/WebProcessPoolQt.cpp index 7661559fe..e2662a7d7 100644 --- a/Source/WebKit2/UIProcess/qt/WebContextQt.cpp +++ b/Source/WebKit2/UIProcess/qt/WebProcessPoolQt.cpp @@ -25,12 +25,16 @@ */ #include "config.h" -#include "WebContext.h" +#include "WebProcessPool.h" -#include "ApplicationCacheStorage.h" +#include "NetworkProcessCreationParameters.h" +#include "QtWebContext.h" #include "WKSharedAPICast.h" +#include "WebCookieManagerProxy.h" #include "WebProcessCreationParameters.h" #include <QProcess> +#include <WebCore/ApplicationCacheStorage.h> +#include <WebCore/Language.h> #if ENABLE(GEOLOCATION) #include "WebGeolocationManagerProxy.h" @@ -39,52 +43,66 @@ namespace WebKit { -String WebContext::platformDefaultApplicationCacheDirectory() const +String WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory() { - const String cacheDirectory = WebCore::cacheStorage().cacheDirectory(); +// QTFIXME +// const String cacheDirectory = WebCore::cacheStorage().cacheDirectory(); - if (cacheDirectory.isEmpty()) - return diskCacheDirectory(); +// if (cacheDirectory.isEmpty()) +// return diskCacheDirectory(); - return cacheDirectory; +// return cacheDirectory; + return API::WebsiteDataStore::defaultApplicationCacheDirectory(); } -void WebContext::platformInitializeWebProcess(WebProcessCreationParameters& parameters) +void WebProcessPool::platformInitializeWebProcess(WebProcessCreationParameters& parameters) { qRegisterMetaType<QProcess::ExitStatus>("QProcess::ExitStatus"); -#if ENABLE(GEOLOCATION) && HAVE(QTLOCATION) +#if ENABLE(GEOLOCATION) && HAVE(QTPOSITIONING) static WebGeolocationProviderQt* location = WebGeolocationProviderQt::create(toAPI(supplement<WebGeolocationManagerProxy>())); WKGeolocationManagerSetProvider(toAPI(supplement<WebGeolocationManagerProxy>()), WebGeolocationProviderQt::provider(location)); #endif } -void WebContext::platformInvalidateContext() +void WebProcessPool::platformInvalidateContext() { } -String WebContext::platformDefaultDatabaseDirectory() const +void WebProcessPool::platformInitializeNetworkProcess(NetworkProcessCreationParameters& parameters) { - return String(); + // QTFIXME + parameters.cookiePersistentStoragePath = QtWebContext::preparedStoragePath(QtWebContext::CookieStorage); + parameters.languages = WebCore::userPreferredLanguages(); } -String WebContext::platformDefaultIconDatabasePath() const +String WebProcessPool::platformDefaultIconDatabasePath() const { - return String(); + return WebKit::QtWebContext::preparedStoragePath(WebKit::QtWebContext::IconDatabaseStorage); } -String WebContext::platformDefaultLocalStorageDirectory() const +String WebProcessPool::legacyPlatformDefaultLocalStorageDirectory() { - return String(); + return WebKit::QtWebContext::preparedStoragePath(WebKit::QtWebContext::LocalStorage); } -String WebContext::platformDefaultDiskCacheDirectory() const +String WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory() { - return String(); + return WebKit::QtWebContext::preparedStoragePath(WebKit::QtWebContext::DatabaseStorage); } -String WebContext::platformDefaultCookieStorageDirectory() const +String WebProcessPool::legacyPlatformDefaultWebSQLDatabaseDirectory() { - return String(); + return WebKit::QtWebContext::preparedStoragePath(WebKit::QtWebContext::DatabaseStorage); +} + +String WebProcessPool::legacyPlatformDefaultMediaKeysStorageDirectory() +{ + return String(); // QTFIXME: Add MediaKeys path +} + +String WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory() +{ + return WebKit::QtWebContext::preparedStoragePath(WebKit::QtWebContext::DiskCacheStorage); } } // namespace WebKit |