summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/webenginewidgets/demobrowser/downloadmanager.cpp2
-rw-r--r--src/core/api/core_api.pro8
-rw-r--r--src/core/api/qwebenginecookiestore.cpp (renamed from src/core/api/qwebenginecookiestoreclient.cpp)128
-rw-r--r--src/core/api/qwebenginecookiestore.h (renamed from src/core/api/qwebenginecookiestoreclient.h)22
-rw-r--r--src/core/api/qwebenginecookiestore_p.h (renamed from src/core/api/qwebenginecookiestoreclient_p.h)21
-rw-r--r--src/core/api/qwebengineurlrequestinfo.cpp20
-rw-r--r--src/core/api/qwebengineurlrequestinfo.h3
-rw-r--r--src/core/api/qwebengineurlrequestinfo_p.h1
-rw-r--r--src/core/api/qwebengineurlrequestinterceptor.h5
-rw-r--r--src/core/api/qwebengineurlschemehandler.cpp8
-rw-r--r--src/core/api/qwebengineurlschemehandler.h4
-rw-r--r--src/core/browser_context_adapter.cpp8
-rw-r--r--src/core/browser_context_adapter.h6
-rw-r--r--src/core/config/windows.pri24
-rw-r--r--src/core/content_client_qt.cpp17
-rw-r--r--src/core/cookie_monster_delegate_qt.cpp12
-rw-r--r--src/core/cookie_monster_delegate_qt.h6
-rw-r--r--src/core/doc/src/qtwebenginecore-module.qdoc10
-rw-r--r--src/core/gyp_run.pro1
-rw-r--r--src/core/network_delegate_qt.cpp3
-rw-r--r--src/core/render_widget_host_view_qt.cpp8
-rw-r--r--src/core/type_conversion.h11
-rw-r--r--src/core/url_request_context_getter_qt.cpp6
-rw-r--r--src/core/web_contents_delegate_qt.cpp1
-rw-r--r--src/webengine/api/qquickwebengineprofile.cpp8
-rw-r--r--src/webengine/api/qquickwebengineprofile_p.h4
-rw-r--r--src/webengine/api/qquickwebenginescript.cpp3
-rw-r--r--src/webengine/api/qquickwebengineview.cpp18
-rw-r--r--src/webengine/doc/src/qtwebengine-index.qdoc23
-rw-r--r--src/webengine/doc/src/qtwebengine-overview.qdoc2
-rw-r--r--src/webengine/doc/src/qtwebengine-platform-notes.qdoc30
-rw-r--r--src/webengine/doc/src/qtwebengine-qmlmodule.qdoc10
-rw-r--r--src/webengine/plugin/plugins.qmltypes2
-rw-r--r--src/webenginewidgets/api/qwebenginehistory.cpp5
-rw-r--r--src/webenginewidgets/api/qwebengineprofile.cpp14
-rw-r--r--src/webenginewidgets/api/qwebengineprofile.h4
-rw-r--r--src/webenginewidgets/doc/src/qtwebkitportingguide.qdoc39
-rw-r--r--src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc6
-rw-r--r--tests/auto/core/core.pro2
-rw-r--r--tests/auto/core/qwebenginecookiestore/qwebenginecookiestore.pro (renamed from tests/auto/core/qwebenginecookiestoreclient/qwebenginecookiestoreclient.pro)0
-rw-r--r--tests/auto/core/qwebenginecookiestore/resources/content.html (renamed from tests/auto/core/qwebenginecookiestoreclient/resources/content.html)0
-rw-r--r--tests/auto/core/qwebenginecookiestore/resources/index.html (renamed from tests/auto/core/qwebenginecookiestoreclient/resources/index.html)0
-rw-r--r--tests/auto/core/qwebenginecookiestore/tst_qwebenginecookiestore.cpp (renamed from tests/auto/core/qwebenginecookiestoreclient/tst_qwebenginecookiestoreclient.cpp)38
-rw-r--r--tests/auto/core/qwebenginecookiestore/tst_qwebenginecookiestore.qrc (renamed from tests/auto/core/qwebenginecookiestoreclient/tst_qwebenginecookiestoreclient.qrc)0
-rw-r--r--tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.cpp8
-rw-r--r--tests/auto/quick/publicapi/tst_publicapi.cpp4
-rw-r--r--tests/quicktestbrowser/main.cpp8
-rwxr-xr-xtools/buildscripts/gyp_qtwebengine8
-rw-r--r--tools/qmake/mkspecs/features/functions.prf31
49 files changed, 360 insertions, 242 deletions
diff --git a/examples/webenginewidgets/demobrowser/downloadmanager.cpp b/examples/webenginewidgets/demobrowser/downloadmanager.cpp
index eab28942e..1c33f12c7 100644
--- a/examples/webenginewidgets/demobrowser/downloadmanager.cpp
+++ b/examples/webenginewidgets/demobrowser/downloadmanager.cpp
@@ -149,7 +149,7 @@ void DownloadWidget::stop()
void DownloadWidget::open()
{
- QUrl url = QUrl::fromLocalFile(m_file.absolutePath());
+ QUrl url = QUrl::fromLocalFile(m_file.absoluteFilePath());
QDesktopServices::openUrl(url);
}
diff --git a/src/core/api/core_api.pro b/src/core/api/core_api.pro
index e4cdf43cb..d11994e98 100644
--- a/src/core/api/core_api.pro
+++ b/src/core/api/core_api.pro
@@ -4,7 +4,7 @@ DESTDIR = $$OUT_PWD/$$getConfigDir()
TEMPLATE = lib
CONFIG += staticlib c++11
-QT += network
+QT += network core-private
# Don't create .prl file for this intermediate library because
# their contents get used when linking against them, breaking
@@ -33,8 +33,8 @@ HEADERS = \
qwebenginecallback_p.h \
qtwebenginecoreglobal.h \
qtwebenginecoreglobal_p.h \
- qwebenginecookiestoreclient.h \
- qwebenginecookiestoreclient_p.h \
+ qwebenginecookiestore.h \
+ qwebenginecookiestore_p.h \
qwebengineurlrequestinterceptor.h \
qwebengineurlrequestinfo.h \
qwebengineurlrequestinfo_p.h \
@@ -42,7 +42,7 @@ HEADERS = \
qwebengineurlschemehandler.h
SOURCES = \
- qwebenginecookiestoreclient.cpp \
+ qwebenginecookiestore.cpp \
qwebengineurlrequestinfo.cpp \
qwebengineurlrequestjob.cpp \
qwebengineurlschemehandler.cpp
diff --git a/src/core/api/qwebenginecookiestoreclient.cpp b/src/core/api/qwebenginecookiestore.cpp
index bd43b871d..51753e87b 100644
--- a/src/core/api/qwebenginecookiestoreclient.cpp
+++ b/src/core/api/qwebenginecookiestore.cpp
@@ -34,8 +34,8 @@
**
****************************************************************************/
-#include "qwebenginecookiestoreclient.h"
-#include "qwebenginecookiestoreclient_p.h"
+#include "qwebenginecookiestore.h"
+#include "qwebenginecookiestore_p.h"
#include <cookie_monster_delegate_qt.h>
@@ -46,7 +46,7 @@ QT_BEGIN_NAMESPACE
using namespace QtWebEngineCore;
-QWebEngineCookieStoreClientPrivate::QWebEngineCookieStoreClientPrivate(QWebEngineCookieStoreClient* q)
+QWebEngineCookieStorePrivate::QWebEngineCookieStorePrivate(QWebEngineCookieStore* q)
: m_nextCallbackId(CallbackDirectory::ReservedCallbackIdsEnd)
, m_deleteSessionCookiesPending(false)
, m_deleteAllCookiesPending(false)
@@ -56,12 +56,7 @@ QWebEngineCookieStoreClientPrivate::QWebEngineCookieStoreClientPrivate(QWebEngin
{
}
-QWebEngineCookieStoreClientPrivate::~QWebEngineCookieStoreClientPrivate()
-{
-
-}
-
-void QWebEngineCookieStoreClientPrivate::processPendingUserCookies()
+void QWebEngineCookieStorePrivate::processPendingUserCookies()
{
Q_ASSERT(delegate);
Q_ASSERT(delegate->hasCookieMonster());
@@ -94,7 +89,7 @@ void QWebEngineCookieStoreClientPrivate::processPendingUserCookies()
m_pendingUserCookies.clear();
}
-void QWebEngineCookieStoreClientPrivate::setCookie(const QWebEngineCallback<bool> &callback, const QNetworkCookie &cookie, const QUrl &origin)
+void QWebEngineCookieStorePrivate::setCookie(const QWebEngineCallback<bool> &callback, const QNetworkCookie &cookie, const QUrl &origin)
{
const quint64 currentCallbackId = callback ? m_nextCallbackId++ : static_cast<quint64>(CallbackDirectory::NoCallbackId);
@@ -109,7 +104,7 @@ void QWebEngineCookieStoreClientPrivate::setCookie(const QWebEngineCallback<bool
delegate->setCookie(currentCallbackId, cookie, origin);
}
-void QWebEngineCookieStoreClientPrivate::deleteCookie(const QNetworkCookie &cookie, const QUrl &url)
+void QWebEngineCookieStorePrivate::deleteCookie(const QNetworkCookie &cookie, const QUrl &url)
{
if (!delegate || !delegate->hasCookieMonster()) {
m_pendingUserCookies.append(CookieData{ CallbackDirectory::DeleteCookieCallbackId, cookie, url });
@@ -119,7 +114,7 @@ void QWebEngineCookieStoreClientPrivate::deleteCookie(const QNetworkCookie &cook
delegate->deleteCookie(cookie, url);
}
-void QWebEngineCookieStoreClientPrivate::deleteSessionCookies()
+void QWebEngineCookieStorePrivate::deleteSessionCookies()
{
if (!delegate || !delegate->hasCookieMonster()) {
m_deleteSessionCookiesPending = true;
@@ -129,7 +124,7 @@ void QWebEngineCookieStoreClientPrivate::deleteSessionCookies()
delegate->deleteSessionCookies(CallbackDirectory::DeleteSessionCookiesCallbackId);
}
-void QWebEngineCookieStoreClientPrivate::deleteAllCookies()
+void QWebEngineCookieStorePrivate::deleteAllCookies()
{
if (!delegate || !delegate->hasCookieMonster()) {
m_deleteAllCookiesPending = true;
@@ -140,7 +135,7 @@ void QWebEngineCookieStoreClientPrivate::deleteAllCookies()
delegate->deleteAllCookies(CallbackDirectory::DeleteAllCookiesCallbackId);
}
-void QWebEngineCookieStoreClientPrivate::getAllCookies()
+void QWebEngineCookieStorePrivate::getAllCookies()
{
if (!delegate || !delegate->hasCookieMonster()) {
m_getAllCookiesPending = true;
@@ -150,48 +145,48 @@ void QWebEngineCookieStoreClientPrivate::getAllCookies()
delegate->getAllCookies(CallbackDirectory::GetAllCookiesCallbackId);
}
-void QWebEngineCookieStoreClientPrivate::onGetAllCallbackResult(qint64 callbackId, const QByteArray &cookieList)
+void QWebEngineCookieStorePrivate::onGetAllCallbackResult(qint64 callbackId, const QByteArray &cookieList)
{
callbackDirectory.invoke(callbackId, cookieList);
}
-void QWebEngineCookieStoreClientPrivate::onSetCallbackResult(qint64 callbackId, bool success)
+void QWebEngineCookieStorePrivate::onSetCallbackResult(qint64 callbackId, bool success)
{
callbackDirectory.invoke(callbackId, success);
}
-void QWebEngineCookieStoreClientPrivate::onDeleteCallbackResult(qint64 callbackId, int numCookies)
+void QWebEngineCookieStorePrivate::onDeleteCallbackResult(qint64 callbackId, int numCookies)
{
callbackDirectory.invoke(callbackId, numCookies);
}
-void QWebEngineCookieStoreClientPrivate::onCookieChanged(const QNetworkCookie &cookie, bool removed)
+void QWebEngineCookieStorePrivate::onCookieChanged(const QNetworkCookie &cookie, bool removed)
{
- Q_Q(QWebEngineCookieStoreClient);
+ Q_Q(QWebEngineCookieStore);
if (removed)
Q_EMIT q->cookieRemoved(cookie);
else
Q_EMIT q->cookieAdded(cookie);
}
-bool QWebEngineCookieStoreClientPrivate::canSetCookie(const QUrl &firstPartyUrl, const QByteArray &cookieLine, const QUrl &url)
+bool QWebEngineCookieStorePrivate::canSetCookie(const QUrl &firstPartyUrl, const QByteArray &cookieLine, const QUrl &url)
{
if (filterCallback) {
- QWebEngineCookieStoreClient::FilterRequest request;
+ QWebEngineCookieStore::FilterRequest request;
request.accepted = true;
request.firstPartyUrl = firstPartyUrl;
request.cookieLine = cookieLine;
request.cookieSource = url;
- callbackDirectory.invokeDirectly<QWebEngineCookieStoreClient::FilterRequest&>(filterCallback, request);
+ callbackDirectory.invokeDirectly<QWebEngineCookieStore::FilterRequest&>(filterCallback, request);
return request.accepted;
}
return true;
}
/*!
- \class QWebEngineCookieStoreClient
+ \class QWebEngineCookieStore
\inmodule QtWebEngineCore
\since 5.6
- \brief The QWebEngineCookieStoreClient class provides access to Chromium's cookies.
+ \brief The QWebEngineCookieStore class provides access to Chromium's cookies.
The class allows to access HTTP cookies of Chromium for a specific profile.
It can be used to synchronize cookies of Chromium and the QNetworkAccessManager, as well as
@@ -203,54 +198,65 @@ bool QWebEngineCookieStoreClientPrivate::canSetCookie(const QUrl &firstPartyUrl,
*/
/*!
- \class QWebEngineCookieStoreClient::FilterRequest
+ \class QWebEngineCookieStore::FilterRequest
\inmodule QtWebEngineCore
\since 5.6
+ \brief The FilterRequest class specifies the properties of a cookie.
- The structure specifies properties of a cookie, and whether it should accepted or not. It is
- used as an argument to a filter installed via setCookieFilter().
+ The class specifies the properties of a cookie and determines whether the cookie should be
+ accepted. The class is used as an argument to a filter installed via setCookieFilter().
*/
/*!
- \variable QWebEngineCookieStoreClient::FilterRequest::accepted
- Whether the cookie shall be accepted. The default is \c true.
- \variable QWebEngineCookieStoreClient::FilterRequest::firstPartyUrl
- URL of page that triggered the setting of the cookie.
- \variable QWebEngineCookieStoreClient::FilterRequest::cookieLine
- Content of the cookie.
- \variable QWebEngineCookieStoreClient::FilterRequest::cookieSource
- URL of site that sets the cookie.
+ \variable QWebEngineCookieStore::FilterRequest::accepted
+ \brief Whether the cookie shall be accepted.
+
+ The default is \c true.
*/
+/*!
+ \variable QWebEngineCookieStore::FilterRequest::firstPartyUrl
+ \brief The URL of the page that triggered the setting of the cookie.
+*/
+
+/*!
+ \variable QWebEngineCookieStore::FilterRequest::cookieLine
+ \brief The content of the cookie.
+*/
+
+/*!
+ \variable QWebEngineCookieStore::FilterRequest::cookieSource
+ \brief The URL of the site that sets the cookie.
+*/
/*!
- \fn void QWebEngineCookieStoreClient::cookieAdded(const QNetworkCookie &cookie)
+ \fn void QWebEngineCookieStore::cookieAdded(const QNetworkCookie &cookie)
This signal is emitted whenever a new \a cookie is added to the cookie store.
*/
/*!
- \fn void QWebEngineCookieStoreClient::cookieRemoved(const QNetworkCookie &cookie)
+ \fn void QWebEngineCookieStore::cookieRemoved(const QNetworkCookie &cookie)
This signal is emitted whenever a \a cookie is deleted from the cookie store.
*/
/*!
- Creates a new QWebEngineCookieStoreClient object with \a parent.
+ Creates a new QWebEngineCookieStore object with \a parent.
*/
-QWebEngineCookieStoreClient::QWebEngineCookieStoreClient(QObject *parent)
+QWebEngineCookieStore::QWebEngineCookieStore(QObject *parent)
: QObject(parent)
- , d_ptr(new QWebEngineCookieStoreClientPrivate(this))
+ , d_ptr(new QWebEngineCookieStorePrivate(this))
{
}
/*!
- Destroys this QWebEngineCookieStoreClient object.
+ Destroys this QWebEngineCookieStore object.
*/
-QWebEngineCookieStoreClient::~QWebEngineCookieStoreClient()
+QWebEngineCookieStore::~QWebEngineCookieStore()
{
}
@@ -266,9 +272,9 @@ QWebEngineCookieStoreClient::~QWebEngineCookieStoreClient()
\sa setCookie()
*/
-void QWebEngineCookieStoreClient::setCookieWithCallback(const QNetworkCookie &cookie, const QWebEngineCallback<bool> &resultCallback, const QUrl &origin)
+void QWebEngineCookieStore::setCookieWithCallback(const QNetworkCookie &cookie, const QWebEngineCallback<bool> &resultCallback, const QUrl &origin)
{
- Q_D(QWebEngineCookieStoreClient);
+ Q_D(QWebEngineCookieStore);
d->setCookie(resultCallback, cookie, origin);
}
@@ -281,7 +287,7 @@ void QWebEngineCookieStoreClient::setCookieWithCallback(const QNetworkCookie &co
\sa setCookieWithCallback()
*/
-void QWebEngineCookieStoreClient::setCookie(const QNetworkCookie &cookie, const QUrl &origin)
+void QWebEngineCookieStore::setCookie(const QNetworkCookie &cookie, const QUrl &origin)
{
setCookieWithCallback(cookie, QWebEngineCallback<bool>(), origin);
}
@@ -293,14 +299,14 @@ void QWebEngineCookieStoreClient::setCookie(const QNetworkCookie &cookie, const
The provided URL should also include the scheme.
*/
-void QWebEngineCookieStoreClient::deleteCookie(const QNetworkCookie &cookie, const QUrl &origin)
+void QWebEngineCookieStore::deleteCookie(const QNetworkCookie &cookie, const QUrl &origin)
{
- Q_D(QWebEngineCookieStoreClient);
+ Q_D(QWebEngineCookieStore);
d->deleteCookie(cookie, origin);
}
/*!
- \fn void QWebEngineCookieStoreClient::getAllCookies(FunctorOrLambda resultCallback)
+ \fn void QWebEngineCookieStore::getAllCookies(FunctorOrLambda resultCallback)
Requests all the cookies in the cookie store. When the asynchronous operation finishes,
\a resultCallback will be called with a QByteArray as the argument containing the cookies.
@@ -309,9 +315,9 @@ void QWebEngineCookieStoreClient::deleteCookie(const QNetworkCookie &cookie, con
\sa deleteCookie()
*/
-void QWebEngineCookieStoreClient::getAllCookies(const QWebEngineCallback<const QByteArray&> &resultCallback)
+void QWebEngineCookieStore::getAllCookies(const QWebEngineCallback<const QByteArray&> &resultCallback)
{
- Q_D(QWebEngineCookieStoreClient);
+ Q_D(QWebEngineCookieStore);
if (d->m_getAllCookiesPending) {
d->callbackDirectory.invokeEmpty(resultCallback);
return;
@@ -321,7 +327,7 @@ void QWebEngineCookieStoreClient::getAllCookies(const QWebEngineCallback<const Q
}
/*!
- \fn void QWebEngineCookieStoreClient::deleteSessionCookiesWithCallback(FunctorOrLambda resultCallback)
+ \fn void QWebEngineCookieStore::deleteSessionCookiesWithCallback(FunctorOrLambda resultCallback)
Deletes all the session cookies in the cookie store. Session cookies do not have an
expiration date assigned to them.
@@ -329,9 +335,9 @@ void QWebEngineCookieStoreClient::getAllCookies(const QWebEngineCallback<const Q
number of cookies deleted as the argument.
*/
-void QWebEngineCookieStoreClient::deleteSessionCookiesWithCallback(const QWebEngineCallback<int> &resultCallback)
+void QWebEngineCookieStore::deleteSessionCookiesWithCallback(const QWebEngineCallback<int> &resultCallback)
{
- Q_D(QWebEngineCookieStoreClient);
+ Q_D(QWebEngineCookieStore);
if (d->m_deleteAllCookiesPending || d->m_deleteSessionCookiesPending) {
d->callbackDirectory.invokeEmpty(resultCallback);
return;
@@ -341,7 +347,7 @@ void QWebEngineCookieStoreClient::deleteSessionCookiesWithCallback(const QWebEng
}
/*!
- \fn void QWebEngineCookieStoreClient::deleteAllCookiesWithCallback(FunctorOrLambda resultCallback)
+ \fn void QWebEngineCookieStore::deleteAllCookiesWithCallback(FunctorOrLambda resultCallback)
Deletes all the cookies in the cookie store. When the asynchronous operation finishes,
\a resultCallback will be called with the number of cookies deleted as the argument.
@@ -349,9 +355,9 @@ void QWebEngineCookieStoreClient::deleteSessionCookiesWithCallback(const QWebEng
\sa deleteSessionCookiesWithCallback(), getAllCookies()
*/
-void QWebEngineCookieStoreClient::deleteAllCookiesWithCallback(const QWebEngineCallback<int> &resultCallback)
+void QWebEngineCookieStore::deleteAllCookiesWithCallback(const QWebEngineCallback<int> &resultCallback)
{
- Q_D(QWebEngineCookieStoreClient);
+ Q_D(QWebEngineCookieStore);
if (d->m_deleteAllCookiesPending) {
d->callbackDirectory.invokeEmpty(resultCallback);
return;
@@ -366,7 +372,7 @@ void QWebEngineCookieStoreClient::deleteAllCookiesWithCallback(const QWebEngineC
\sa deleteSessionCookiesWithCallback()
*/
-void QWebEngineCookieStoreClient::deleteSessionCookies()
+void QWebEngineCookieStore::deleteSessionCookies()
{
deleteSessionCookiesWithCallback(QWebEngineCallback<int>());
}
@@ -377,13 +383,13 @@ void QWebEngineCookieStoreClient::deleteSessionCookies()
\sa deleteAllCookiesWithCallback(), getAllCookies()
*/
-void QWebEngineCookieStoreClient::deleteAllCookies()
+void QWebEngineCookieStore::deleteAllCookies()
{
deleteAllCookiesWithCallback(QWebEngineCallback<int>());
}
/*!
- \fn void QWebEngineCookieStoreClient::setCookieFilter(FunctorOrLambda filterCallback)
+ \fn void QWebEngineCookieStore::setCookieFilter(FunctorOrLambda filterCallback)
Installs a cookie filter that can reject cookies before they are added to the cookie store.
The \a filterCallback must be a lambda or functor taking FilterRequest structure. If the
@@ -394,9 +400,9 @@ void QWebEngineCookieStoreClient::deleteAllCookies()
\sa deleteAllCookiesWithCallback(), getAllCookies()
*/
-void QWebEngineCookieStoreClient::setCookieFilter(const QWebEngineCallback<QWebEngineCookieStoreClient::FilterRequest&> &filter)
+void QWebEngineCookieStore::setCookieFilter(const QWebEngineCallback<QWebEngineCookieStore::FilterRequest&> &filter)
{
- Q_D(QWebEngineCookieStoreClient);
+ Q_D(QWebEngineCookieStore);
d->filterCallback = filter;
}
diff --git a/src/core/api/qwebenginecookiestoreclient.h b/src/core/api/qwebenginecookiestore.h
index 4664a8459..6cbe399f2 100644
--- a/src/core/api/qwebenginecookiestoreclient.h
+++ b/src/core/api/qwebenginecookiestore.h
@@ -34,8 +34,8 @@
**
****************************************************************************/
-#ifndef QWEBENGINECOOKIESTORECLIENT_H
-#define QWEBENGINECOOKIESTORECLIENT_H
+#ifndef QWEBENGINECOOKIESTORE_H
+#define QWEBENGINECOOKIESTORE_H
#include "qtwebenginecoreglobal.h"
#include "qwebenginecallback.h"
@@ -52,8 +52,8 @@ class CookieMonsterDelegateQt;
QT_BEGIN_NAMESPACE
-class QWebEngineCookieStoreClientPrivate;
-class QWEBENGINE_EXPORT QWebEngineCookieStoreClient : public QObject {
+class QWebEngineCookieStorePrivate;
+class QWEBENGINE_EXPORT QWebEngineCookieStore : public QObject {
Q_OBJECT
public:
@@ -64,7 +64,7 @@ public:
QByteArray cookieLine;
QUrl cookieSource;
};
- virtual ~QWebEngineCookieStoreClient();
+ virtual ~QWebEngineCookieStore();
#ifdef Q_QDOC
void setCookieWithCallback(const QNetworkCookie &cookie, FunctorOrLambda resultCallback, const QUrl &origin = QUrl());
@@ -89,16 +89,16 @@ Q_SIGNALS:
void cookieRemoved(const QNetworkCookie &cookie);
private:
- explicit QWebEngineCookieStoreClient(QObject *parent = 0);
+ explicit QWebEngineCookieStore(QObject *parent = 0);
friend class QtWebEngineCore::BrowserContextAdapter;
friend class QtWebEngineCore::CookieMonsterDelegateQt;
- Q_DISABLE_COPY(QWebEngineCookieStoreClient)
- Q_DECLARE_PRIVATE(QWebEngineCookieStoreClient)
- QScopedPointer<QWebEngineCookieStoreClientPrivate> d_ptr;
+ Q_DISABLE_COPY(QWebEngineCookieStore)
+ Q_DECLARE_PRIVATE(QWebEngineCookieStore)
+ QScopedPointer<QWebEngineCookieStorePrivate> d_ptr;
};
QT_END_NAMESPACE
-Q_DECLARE_METATYPE(QWebEngineCookieStoreClient*)
+Q_DECLARE_METATYPE(QWebEngineCookieStore*)
-#endif // QWEBENGINECOOKIESTORECLIENT_H
+#endif // QWEBENGINECOOKIESTORE_H
diff --git a/src/core/api/qwebenginecookiestoreclient_p.h b/src/core/api/qwebenginecookiestore_p.h
index 54f3b9eb7..d773c0d3e 100644
--- a/src/core/api/qwebenginecookiestoreclient_p.h
+++ b/src/core/api/qwebenginecookiestore_p.h
@@ -34,8 +34,8 @@
**
****************************************************************************/
-#ifndef QWEBENGINECOOKIESTORECLIENT_P_H
-#define QWEBENGINECOOKIESTORECLIENT_P_H
+#ifndef QWEBENGINECOOKIESTORE_P_H
+#define QWEBENGINECOOKIESTORE_P_H
//
// W A R N I N G
@@ -51,7 +51,7 @@
#include "qtwebenginecoreglobal_p.h"
#include "qwebenginecallback_p.h"
-#include "qwebenginecookiestoreclient.h"
+#include "qwebenginecookiestore.h"
#include <QVector>
#include <QNetworkCookie>
@@ -63,7 +63,7 @@ class CookieMonsterDelegateQt;
QT_BEGIN_NAMESPACE
-class QWEBENGINE_PRIVATE_EXPORT QWebEngineCookieStoreClientPrivate {
+class QWEBENGINE_PRIVATE_EXPORT QWebEngineCookieStorePrivate {
struct CookieData {
quint64 callbackId;
QNetworkCookie cookie;
@@ -71,9 +71,9 @@ class QWEBENGINE_PRIVATE_EXPORT QWebEngineCookieStoreClientPrivate {
};
friend class QTypeInfo<CookieData>;
public:
- Q_DECLARE_PUBLIC(QWebEngineCookieStoreClient)
+ Q_DECLARE_PUBLIC(QWebEngineCookieStore)
QtWebEngineCore::CallbackDirectory callbackDirectory;
- QWebEngineCallback<QWebEngineCookieStoreClient::FilterRequest&> filterCallback;
+ QWebEngineCallback<QWebEngineCookieStore::FilterRequest&> filterCallback;
QVector<CookieData> m_pendingUserCookies;
quint64 m_nextCallbackId;
bool m_deleteSessionCookiesPending;
@@ -81,10 +81,9 @@ public:
bool m_getAllCookiesPending;
QtWebEngineCore::CookieMonsterDelegateQt *delegate;
- QWebEngineCookieStoreClient *q_ptr;
+ QWebEngineCookieStore *q_ptr;
- QWebEngineCookieStoreClientPrivate(QWebEngineCookieStoreClient *q);
- ~QWebEngineCookieStoreClientPrivate();
+ QWebEngineCookieStorePrivate(QWebEngineCookieStore *q);
void processPendingUserCookies();
void setCookie(const QWebEngineCallback<bool> &callback, const QNetworkCookie &cookie, const QUrl &origin);
@@ -101,8 +100,8 @@ public:
void onCookieChanged(const QNetworkCookie &cookie, bool removed);
};
-Q_DECLARE_TYPEINFO(QWebEngineCookieStoreClientPrivate::CookieData, Q_MOVABLE_TYPE);
+Q_DECLARE_TYPEINFO(QWebEngineCookieStorePrivate::CookieData, Q_MOVABLE_TYPE);
QT_END_NAMESPACE
-#endif // QWEBENGINECOOKIESTORECLIENT_P_H
+#endif // QWEBENGINECOOKIESTORE_P_H
diff --git a/src/core/api/qwebengineurlrequestinfo.cpp b/src/core/api/qwebengineurlrequestinfo.cpp
index e8ce65be3..79801d190 100644
--- a/src/core/api/qwebengineurlrequestinfo.cpp
+++ b/src/core/api/qwebengineurlrequestinfo.cpp
@@ -101,12 +101,6 @@ ASSERT_ENUMS_MATCH(QtWebEngineCore::WebContentsAdapterClient::OtherNavigation, Q
*/
/*!
- \fn QWebEngineUrlRequestInterceptor::~QWebEngineUrlRequestInterceptor()
-
- Destroys this QWebEngineUrlRequestInterceptor object.
-*/
-
-/*!
\fn bool QWebEngineUrlRequestInterceptor::interceptRequest(QWebEngineUrlRequestInfo &info)
Reimplementing this virtual function and setting the interceptor on a profile makes
@@ -126,6 +120,7 @@ QWebEngineUrlRequestInfoPrivate::QWebEngineUrlRequestInfoPrivate(QWebEngineUrlRe
, url(u)
, firstPartyUrl(fpu)
, method(m)
+ , changed(false)
{
}
@@ -241,6 +236,12 @@ QByteArray QWebEngineUrlRequestInfo::requestMethod() const
return d->method;
}
+bool QWebEngineUrlRequestInfo::changed() const
+{
+ Q_D(const QWebEngineUrlRequestInfo);
+ return d->changed;
+}
+
/*!
Redirects this request to \a url.
It is only possible to redirect requests that do not have payload data, such as GET requests.
@@ -249,6 +250,7 @@ QByteArray QWebEngineUrlRequestInfo::requestMethod() const
void QWebEngineUrlRequestInfo::redirect(const QUrl &url)
{
Q_D(QWebEngineUrlRequestInfo);
+ d->changed = true;
d->url = url;
}
@@ -261,16 +263,18 @@ void QWebEngineUrlRequestInfo::redirect(const QUrl &url)
void QWebEngineUrlRequestInfo::block(bool shouldBlock)
{
Q_D(QWebEngineUrlRequestInfo);
+ d->changed = true;
d->shouldBlockRequest = shouldBlock;
}
/*!
- Sets an extra request header for this request with \a name and \a value.
+ Sets the request header \a name to \a value for this request.
*/
-void QWebEngineUrlRequestInfo::setExtraHeader(const QByteArray &name, const QByteArray &value)
+void QWebEngineUrlRequestInfo::setHttpHeader(const QByteArray &name, const QByteArray &value)
{
Q_D(QWebEngineUrlRequestInfo);
+ d->changed = true;
d->extraHeaders.insert(name, value);
}
diff --git a/src/core/api/qwebengineurlrequestinfo.h b/src/core/api/qwebengineurlrequestinfo.h
index e6e225051..008df7751 100644
--- a/src/core/api/qwebengineurlrequestinfo.h
+++ b/src/core/api/qwebengineurlrequestinfo.h
@@ -88,10 +88,11 @@ public:
QUrl requestUrl() const;
QUrl firstPartyUrl() const;
QByteArray requestMethod() const;
+ bool changed() const;
void block(bool shouldBlock);
void redirect(const QUrl &url);
- void setExtraHeader(const QByteArray &name, const QByteArray &value);
+ void setHttpHeader(const QByteArray &name, const QByteArray &value);
private:
friend class QtWebEngineCore::NetworkDelegateQt;
diff --git a/src/core/api/qwebengineurlrequestinfo_p.h b/src/core/api/qwebengineurlrequestinfo_p.h
index 1b1279d27..df5f18d6e 100644
--- a/src/core/api/qwebengineurlrequestinfo_p.h
+++ b/src/core/api/qwebengineurlrequestinfo_p.h
@@ -68,6 +68,7 @@ public:
QUrl url;
QUrl firstPartyUrl;
const QByteArray method;
+ bool changed;
QHash<QByteArray, QByteArray> extraHeaders;
QWebEngineUrlRequestInfo *q_ptr;
diff --git a/src/core/api/qwebengineurlrequestinterceptor.h b/src/core/api/qwebengineurlrequestinterceptor.h
index 72f3452d0..372ee9066 100644
--- a/src/core/api/qwebengineurlrequestinterceptor.h
+++ b/src/core/api/qwebengineurlrequestinterceptor.h
@@ -56,11 +56,8 @@ public:
: QObject (p)
{
}
- virtual ~QWebEngineUrlRequestInterceptor()
- {
- }
- virtual bool interceptRequest(QWebEngineUrlRequestInfo &info) = 0;
+ virtual void interceptRequest(QWebEngineUrlRequestInfo &info) = 0;
};
QT_END_NAMESPACE
diff --git a/src/core/api/qwebengineurlschemehandler.cpp b/src/core/api/qwebengineurlschemehandler.cpp
index 7f9ebaf48..485db0b4b 100644
--- a/src/core/api/qwebengineurlschemehandler.cpp
+++ b/src/core/api/qwebengineurlschemehandler.cpp
@@ -53,12 +53,6 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \fn QWebEngineUrlSchemeHandler::destroyed(QWebEngineUrlSchemeHandler *handler)
-
- This signal is emitted when the custom URL scheme handler \a handler is deleted.
-*/
-
-/*!
Constructs a new URL scheme handler.
The handler is created with the parent \a parent.
@@ -74,7 +68,7 @@ QWebEngineUrlSchemeHandler::QWebEngineUrlSchemeHandler(QObject *parent)
*/
QWebEngineUrlSchemeHandler::~QWebEngineUrlSchemeHandler()
{
- Q_EMIT destroyed(this);
+ Q_EMIT _q_destroyedUrlSchemeHandler(this);
}
/*!
diff --git a/src/core/api/qwebengineurlschemehandler.h b/src/core/api/qwebengineurlschemehandler.h
index 66aebe00d..fa24987c5 100644
--- a/src/core/api/qwebengineurlschemehandler.h
+++ b/src/core/api/qwebengineurlschemehandler.h
@@ -57,8 +57,10 @@ public:
virtual void requestStarted(QWebEngineUrlRequestJob*) = 0;
+#ifndef Q_QDOC
Q_SIGNALS:
- void destroyed(QWebEngineUrlSchemeHandler*);
+ void _q_destroyedUrlSchemeHandler(QWebEngineUrlSchemeHandler*);
+#endif
private:
Q_DISABLE_COPY(QWebEngineUrlSchemeHandler)
diff --git a/src/core/browser_context_adapter.cpp b/src/core/browser_context_adapter.cpp
index b5fdf2ce0..7b40688a1 100644
--- a/src/core/browser_context_adapter.cpp
+++ b/src/core/browser_context_adapter.cpp
@@ -136,11 +136,11 @@ DownloadManagerDelegateQt *BrowserContextAdapter::downloadManagerDelegate()
return m_downloadManagerDelegate.data();
}
-QWebEngineCookieStoreClient *BrowserContextAdapter::cookieStoreClient()
+QWebEngineCookieStore *BrowserContextAdapter::cookieStore()
{
- if (!m_cookieStoreClient)
- m_cookieStoreClient.reset(new QWebEngineCookieStoreClient);
- return m_cookieStoreClient.data();
+ if (!m_cookieStore)
+ m_cookieStore.reset(new QWebEngineCookieStore);
+ return m_cookieStore.data();
}
QWebEngineUrlRequestInterceptor *BrowserContextAdapter::requestInterceptor()
diff --git a/src/core/browser_context_adapter.h b/src/core/browser_context_adapter.h
index 818dfda3d..97a4dca4a 100644
--- a/src/core/browser_context_adapter.h
+++ b/src/core/browser_context_adapter.h
@@ -46,7 +46,7 @@
#include <QString>
#include <QVector>
-#include "api/qwebenginecookiestoreclient.h"
+#include "api/qwebenginecookiestore.h"
#include "api/qwebengineurlrequestinterceptor.h"
#include "api/qwebengineurlschemehandler.h"
@@ -73,7 +73,7 @@ public:
WebEngineVisitedLinksManager *visitedLinksManager();
DownloadManagerDelegateQt *downloadManagerDelegate();
- QWebEngineCookieStoreClient *cookieStoreClient();
+ QWebEngineCookieStore *cookieStore();
QWebEngineUrlRequestInterceptor* requestInterceptor();
void setRequestInterceptor(QWebEngineUrlRequestInterceptor *interceptor);
@@ -164,7 +164,7 @@ private:
QScopedPointer<WebEngineVisitedLinksManager> m_visitedLinksManager;
QScopedPointer<DownloadManagerDelegateQt> m_downloadManagerDelegate;
QScopedPointer<UserScriptControllerHost> m_userScriptController;
- QScopedPointer<QWebEngineCookieStoreClient> m_cookieStoreClient;
+ QScopedPointer<QWebEngineCookieStore> m_cookieStore;
QPointer<QWebEngineUrlRequestInterceptor> m_requestInterceptor;
QString m_dataPath;
diff --git a/src/core/config/windows.pri b/src/core/config/windows.pri
index f0c0c8f43..1e875f308 100644
--- a/src/core/config/windows.pri
+++ b/src/core/config/windows.pri
@@ -28,6 +28,25 @@ contains(QT_CONFIG, angle) {
GYP_ARGS += "-D qt_gl=\"opengl\""
}
+defineTest(usingMSVC32BitCrossCompiler) {
+ CL_DIR =
+ for(dir, QMAKE_PATH_ENV) {
+ exists($$dir/cl.exe) {
+ CL_DIR = $$dir
+ break()
+ }
+ }
+ isEmpty(CL_DIR): {
+ warning(Cannot determine location of cl.exe.)
+ return(false)
+ }
+ CL_DIR = $$system_path($$CL_DIR)
+ CL_DIR = $$split(CL_DIR, \\)
+ CL_PLATFORM = $$last(CL_DIR)
+ equals(CL_PLATFORM, amd64_x86): return(true)
+ return(false)
+}
+
msvc {
equals(MSVC_VER, 12.0) {
MSVS_VERSION = 2013
@@ -44,6 +63,11 @@ msvc {
# is building for, not the system's actual architecture.
PROGRAM_FILES_X86 = $$(ProgramW6432)
isEmpty(PROGRAM_FILES_X86): GYP_ARGS += "-D windows_sdk_path=\"C:/Program Files/Windows Kits/8.1\""
+
+ contains(QT_ARCH, "i386"):!usingMSVC32BitCrossCompiler() {
+ # The 32 bit MSVC linker runs out of memory if we do not remove all debug information.
+ GYP_CONFIG += fastbuild=2
+ }
} else {
fatal("Qt WebEngine for Windows can only be built with the Microsoft Visual Studio C++ compiler")
}
diff --git a/src/core/content_client_qt.cpp b/src/core/content_client_qt.cpp
index 48e563a47..59991d558 100644
--- a/src/core/content_client_qt.cpp
+++ b/src/core/content_client_qt.cpp
@@ -106,10 +106,19 @@ void AddPepperFlashFromSystem(std::vector<content::PepperPluginInfo>* plugins)
{
QStringList pluginPaths;
#if defined(Q_OS_WIN) && defined(Q_PROCESSOR_X86_32)
- QDir pluginDir("C:/Windows/SysWOW64/Macromed/Flash");
- pluginDir.setFilter(QDir::Files);
- QStringList nameFilters("pepflashplayer*.dll");
- pluginPaths << pluginDir.entryList(nameFilters);
+ QString winDir = QDir::fromNativeSeparators(qgetenv("WINDIR"));
+ if (winDir.isEmpty())
+ winDir = QString::fromLatin1("C:/Windows");
+
+ const QStringList pluginDirs = { winDir + "/SysWOW64/Macromed/Flash",
+ winDir + "/System32/Macromed/Flash" };
+ const QStringList nameFilters("pepflashplayer*.dll");
+ Q_FOREACH (const QString &dirPath, pluginDirs) {
+ QDir pluginDir(dirPath);
+ pluginDir.setFilter(QDir::Files);
+ Q_FOREACH (const QFileInfo &info, pluginDir.entryInfoList(nameFilters))
+ pluginPaths << info.absoluteFilePath();
+ }
#endif
#if defined(Q_OS_OSX)
pluginPaths << "/Library/Internet Plug-Ins/PepperFlashPlayer/PepperFlashPlayer.plugin"; // Mac OS X
diff --git a/src/core/cookie_monster_delegate_qt.cpp b/src/core/cookie_monster_delegate_qt.cpp
index 7622614ca..a81670a6c 100644
--- a/src/core/cookie_monster_delegate_qt.cpp
+++ b/src/core/cookie_monster_delegate_qt.cpp
@@ -40,8 +40,8 @@
#include "content/public/browser/browser_thread.h"
#include "net/cookies/cookie_util.h"
-#include "api/qwebenginecookiestoreclient.h"
-#include "api/qwebenginecookiestoreclient_p.h"
+#include "api/qwebenginecookiestore.h"
+#include "api/qwebenginecookiestore_p.h"
#include "type_conversion.h"
#include <QStringBuilder>
@@ -53,15 +53,15 @@ static GURL sourceUrlForCookie(const QNetworkCookie &cookie) {
return net::cookie_util::CookieOriginToURL(urlFragment.toStdString(), /* is_https */ cookie.isSecure());
}
-static void onSetCookieCallback(QWebEngineCookieStoreClientPrivate *client, qint64 callbackId, bool success) {
+static void onSetCookieCallback(QWebEngineCookieStorePrivate *client, qint64 callbackId, bool success) {
client->onSetCallbackResult(callbackId, success);
}
-static void onDeleteCookiesCallback(QWebEngineCookieStoreClientPrivate *client, qint64 callbackId, int numCookies) {
+static void onDeleteCookiesCallback(QWebEngineCookieStorePrivate *client, qint64 callbackId, int numCookies) {
client->onDeleteCallbackResult(callbackId, numCookies);
}
-static void onGetAllCookiesCallback(QWebEngineCookieStoreClientPrivate *client, qint64 callbackId, const net::CookieList& cookies) {
+static void onGetAllCookiesCallback(QWebEngineCookieStorePrivate *client, qint64 callbackId, const net::CookieList& cookies) {
QByteArray rawCookies;
for (auto&& cookie: cookies)
rawCookies += toQt(cookie).toRawForm() % QByteArrayLiteral("\n");
@@ -145,7 +145,7 @@ void CookieMonsterDelegateQt::setCookieMonster(net::CookieMonster* monster)
m_client->d_func()->processPendingUserCookies();
}
-void CookieMonsterDelegateQt::setClient(QWebEngineCookieStoreClient *client)
+void CookieMonsterDelegateQt::setClient(QWebEngineCookieStore *client)
{
m_client = client;
diff --git a/src/core/cookie_monster_delegate_qt.h b/src/core/cookie_monster_delegate_qt.h
index db80bf0a1..c9f27c2bc 100644
--- a/src/core/cookie_monster_delegate_qt.h
+++ b/src/core/cookie_monster_delegate_qt.h
@@ -50,7 +50,7 @@ QT_WARNING_POP
#include <QNetworkCookie>
#include <QPointer>
-QT_FORWARD_DECLARE_CLASS(QWebEngineCookieStoreClient)
+QT_FORWARD_DECLARE_CLASS(QWebEngineCookieStore)
namespace QtWebEngineCore {
@@ -62,7 +62,7 @@ static const char* const kCookieableSchemes[] =
{ "http", "https", "qrc", "ws", "wss" };
class QWEBENGINE_EXPORT CookieMonsterDelegateQt: public net::CookieMonsterDelegate {
- QPointer<QWebEngineCookieStoreClient> m_client;
+ QPointer<QWebEngineCookieStore> m_client;
scoped_refptr<net::CookieMonster> m_cookieMonster;
public:
CookieMonsterDelegateQt();
@@ -77,7 +77,7 @@ public:
void deleteAllCookies(quint64 callbackId);
void setCookieMonster(net::CookieMonster* monster);
- void setClient(QWebEngineCookieStoreClient *client);
+ void setClient(QWebEngineCookieStore *client);
bool canSetCookie(const QUrl &firstPartyUrl, const QByteArray &cookieLine, const QUrl &url);
void OnCookieChanged(const net::CanonicalCookie& cookie, bool removed, ChangeCause cause) override;
diff --git a/src/core/doc/src/qtwebenginecore-module.qdoc b/src/core/doc/src/qtwebenginecore-module.qdoc
index 750a0244e..d0224c834 100644
--- a/src/core/doc/src/qtwebenginecore-module.qdoc
+++ b/src/core/doc/src/qtwebenginecore-module.qdoc
@@ -39,6 +39,12 @@
\snippet qtwebenginecore_build_snippet.qdoc 1
If you use qmake to build your projects, Qt WebEngine Core is usually
- indirectly included through the \l[QtWebEngine]{Qt WebEngine} or
- \l[QtWebEngineWidgets]{Qt WebEngine Widgets} modules.
+ indirectly included through the \l{Qt WebEngine QML Types}{Qt WebEngine} or
+ \l{Qt WebEngine Widgets C++ Classes}{Qt WebEngine Widgets} modules.
+
+ To link against the module, add this line to your qmake project file:
+
+ \snippet qtwebenginecore_build_snippet.qdoc 0
+
+ However, \c webenginecore is implied by adding \c webengine or \c webenginewidgets.
*/
diff --git a/src/core/gyp_run.pro b/src/core/gyp_run.pro
index def7d4698..79e1dca64 100644
--- a/src/core/gyp_run.pro
+++ b/src/core/gyp_run.pro
@@ -83,6 +83,7 @@ contains(QT_ARCH, "arm") {
contains(QT_ARCH, "x86_64"): GYP_CONFIG += target_arch=x64
contains(QT_ARCH, "i386"): GYP_CONFIG += target_arch=ia32
+contains(QT_ARCH, "arm64"): GYP_CONFIG += target_arch=arm64
contains(WEBENGINE_CONFIG, use_proprietary_codecs): GYP_CONFIG += proprietary_codecs=1 ffmpeg_branding=Chrome
diff --git a/src/core/network_delegate_qt.cpp b/src/core/network_delegate_qt.cpp
index 5e6b71e67..a80003a55 100644
--- a/src/core/network_delegate_qt.cpp
+++ b/src/core/network_delegate_qt.cpp
@@ -109,7 +109,8 @@ int NetworkDelegateQt::OnBeforeURLRequest(net::URLRequest *request, const net::C
, toQt(request->first_party_for_cookies())
, QByteArray::fromStdString(request->method()));
QWebEngineUrlRequestInfo requestInfo(infoPrivate);
- if (interceptor->interceptRequest(requestInfo)) {
+ interceptor->interceptRequest(requestInfo);
+ if (requestInfo.changed()) {
int result = infoPrivate->shouldBlockRequest ? net::ERR_ABORTED : net::OK;
if (qUrl != infoPrivate->url)
diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp
index d2d292ee9..f8edcdfc9 100644
--- a/src/core/render_widget_host_view_qt.cpp
+++ b/src/core/render_widget_host_view_qt.cpp
@@ -75,6 +75,7 @@
#include <QTextFormat>
#include <QKeyEvent>
#include <QMouseEvent>
+#include <QPixmap>
#include <QScreen>
#include <QStyleHints>
#include <QVariant>
@@ -534,7 +535,12 @@ void RenderWidgetHostViewQt::UpdateCursor(const content::WebCursor &webCursor)
shape = Qt::ClosedHandCursor;
break;
case blink::WebCursorInfo::TypeCustom:
- // FIXME: Extract from the CursorInfo.
+ if (cursorInfo.custom_image.colorType() == SkColorType::kN32_SkColorType) {
+ QImage cursor = toQImage(cursorInfo.custom_image, QImage::Format_ARGB32);
+ m_delegate->updateCursor(QCursor(QPixmap::fromImage(cursor)));
+ return;
+ }
+ // Use arrow cursor as fallback in case the Chromium implementation changes.
shape = Qt::ArrowCursor;
break;
default:
diff --git a/src/core/type_conversion.h b/src/core/type_conversion.h
index 84b66c62c..abc002ea5 100644
--- a/src/core/type_conversion.h
+++ b/src/core/type_conversion.h
@@ -40,6 +40,7 @@
#include <QColor>
#include <QDateTime>
#include <QDir>
+#include <QImage>
#include <QMatrix4x4>
#include <QNetworkCookie>
#include <QRect>
@@ -49,8 +50,10 @@
#include "base/time/time.h"
#include "content/public/common/file_chooser_file_info.h"
#include "net/cookies/canonical_cookie.h"
-#include "third_party/skia/include/utils/SkMatrix44.h"
+#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkColor.h"
+#include "third_party/skia/include/core/SkPixelRef.h"
+#include "third_party/skia/include/utils/SkMatrix44.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/rect_f.h"
#include "url/gurl.h"
@@ -140,6 +143,12 @@ inline SkColor toSk(const QColor &c)
return c.rgba();
}
+inline QImage toQImage(const SkBitmap &bitmap, QImage::Format format)
+{
+ SkPixelRef *pixelRef = bitmap.pixelRef();
+ return QImage((uchar *)pixelRef->pixels(), bitmap.width(), bitmap.height(), format);
+}
+
inline QMatrix4x4 toQt(const SkMatrix44 &m)
{
QMatrix4x4 qtMatrix(
diff --git a/src/core/url_request_context_getter_qt.cpp b/src/core/url_request_context_getter_qt.cpp
index 32ceb5db5..121a103b0 100644
--- a/src/core/url_request_context_getter_qt.cpp
+++ b/src/core/url_request_context_getter_qt.cpp
@@ -74,8 +74,8 @@
#include "network_delegate_qt.h"
#include "proxy_config_service_qt.h"
#include "qrc_protocol_handler_qt.h"
-#include "qwebenginecookiestoreclient.h"
-#include "qwebenginecookiestoreclient_p.h"
+#include "qwebenginecookiestore.h"
+#include "qwebenginecookiestore_p.h"
#include "type_conversion.h"
namespace QtWebEngineCore {
@@ -204,7 +204,7 @@ void URLRequestContextGetterQt::generateCookieStore()
// Unset it first to get a chance to destroy and flush the old cookie store before before opening a new on possibly the same file.
m_storage->set_cookie_store(0);
m_cookieDelegate->setCookieMonster(0);
- m_cookieDelegate->setClient(m_browserContext->cookieStoreClient());
+ m_cookieDelegate->setClient(m_browserContext->cookieStore());
net::CookieStore* cookieStore = 0;
switch (m_browserContext->persistentCookiesPolicy()) {
diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp
index 2d707149d..f1c9a7f34 100644
--- a/src/core/web_contents_delegate_qt.cpp
+++ b/src/core/web_contents_delegate_qt.cpp
@@ -107,6 +107,7 @@ content::WebContents *WebContentsDelegateQt::OpenURLFromTab(content::WebContents
load_url_params.extra_headers = params.extra_headers;
load_url_params.should_replace_current_entry = params.should_replace_current_entry;
load_url_params.is_renderer_initiated = params.is_renderer_initiated;
+ load_url_params.override_user_agent = content::NavigationController::UA_OVERRIDE_TRUE;
if (params.transferred_global_request_id != content::GlobalRequestID())
load_url_params.transferred_global_request_id = params.transferred_global_request_id;
diff --git a/src/webengine/api/qquickwebengineprofile.cpp b/src/webengine/api/qquickwebengineprofile.cpp
index a678fe5fa..303f038a8 100644
--- a/src/webengine/api/qquickwebengineprofile.cpp
+++ b/src/webengine/api/qquickwebengineprofile.cpp
@@ -40,7 +40,7 @@
#include "qquickwebenginedownloaditem_p_p.h"
#include "qquickwebengineprofile_p_p.h"
#include "qquickwebenginesettings_p.h"
-#include "qwebenginecookiestoreclient.h"
+#include "qwebenginecookiestore.h"
#include <QQmlEngine>
@@ -165,6 +165,8 @@ void QQuickWebEngineProfilePrivate::downloadUpdated(const DownloadItemInfo &info
QQuickWebEngineProfile::QQuickWebEngineProfile()
: d_ptr(new QQuickWebEngineProfilePrivate(new BrowserContextAdapter(false)))
{
+ // Sets up the global WebEngineContext
+ QQuickWebEngineProfile::defaultProfile();
d_ptr->q_ptr = this;
}
@@ -419,10 +421,10 @@ QQuickWebEngineProfile *QQuickWebEngineProfile::defaultProfile()
return profile;
}
-QWebEngineCookieStoreClient *QQuickWebEngineProfile::cookieStoreClient() const
+QWebEngineCookieStore *QQuickWebEngineProfile::cookieStore() const
{
const Q_D(QQuickWebEngineProfile);
- return d->browserContext()->cookieStoreClient();
+ return d->browserContext()->cookieStore();
}
QQuickWebEngineSettings *QQuickWebEngineProfile::settings() const
diff --git a/src/webengine/api/qquickwebengineprofile_p.h b/src/webengine/api/qquickwebengineprofile_p.h
index 1ed15aec2..5839d51a5 100644
--- a/src/webengine/api/qquickwebengineprofile_p.h
+++ b/src/webengine/api/qquickwebengineprofile_p.h
@@ -63,7 +63,7 @@ QT_BEGIN_NAMESPACE
class QQuickWebEngineDownloadItem;
class QQuickWebEngineProfilePrivate;
class QQuickWebEngineSettings;
-class QWebEngineCookieStoreClient;
+class QWebEngineCookieStore;
class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineProfile : public QObject {
Q_OBJECT
@@ -122,7 +122,7 @@ public:
static QQuickWebEngineProfile *defaultProfile();
- Q_REVISION(1) Q_INVOKABLE QWebEngineCookieStoreClient *cookieStoreClient() const;
+ Q_REVISION(1) Q_INVOKABLE QWebEngineCookieStore *cookieStore() const;
signals:
void storageNameChanged();
diff --git a/src/webengine/api/qquickwebenginescript.cpp b/src/webengine/api/qquickwebenginescript.cpp
index affffbf46..71dad701f 100644
--- a/src/webengine/api/qquickwebenginescript.cpp
+++ b/src/webengine/api/qquickwebenginescript.cpp
@@ -37,6 +37,7 @@
#include "qquickwebenginescript_p.h"
#include "qquickwebenginescript_p_p.h"
+#include <QQmlFile>
#include <QtCore/QDebug>
#include <QtCore/QFile>
#include <QtCore/QStringBuilder>
@@ -178,7 +179,7 @@ void QQuickWebEngineScript::setSourceUrl(QUrl arg)
d->m_sourceUrl = arg;
Q_EMIT sourceUrlChanged(d->m_sourceUrl);
- QFile f(arg.toLocalFile());
+ QFile f(QQmlFile::urlToLocalFileOrQrc(arg));
if (!f.open(QIODevice::ReadOnly)) {
qWarning() << "Can't open user script " << arg;
return;
diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp
index 19ef590b8..9e0da060e 100644
--- a/src/webengine/api/qquickwebengineview.cpp
+++ b/src/webengine/api/qquickwebengineview.cpp
@@ -669,6 +669,18 @@ QAccessible::State QQuickWebEngineViewAccessible::state() const
}
#endif // QT_NO_ACCESSIBILITY
+class WebContentsAdapterOwner : public QObject
+{
+public:
+ typedef QExplicitlySharedDataPointer<QtWebEngineCore::WebContentsAdapter> AdapterPtr;
+ WebContentsAdapterOwner(const AdapterPtr &ptr)
+ : adapter(ptr)
+ {}
+
+private:
+ AdapterPtr adapter;
+};
+
void QQuickWebEngineViewPrivate::adoptWebContents(WebContentsAdapter *webContents)
{
if (!webContents) {
@@ -692,6 +704,8 @@ void QQuickWebEngineViewPrivate::adoptWebContents(WebContentsAdapter *webContent
// This throws away the WebContentsAdapter that has been used until now.
// All its states, particularly the loading URL, are replaced by the adopted WebContentsAdapter.
+ WebContentsAdapterOwner *adapterOwner = new WebContentsAdapterOwner(adapter);
+ adapterOwner->deleteLater();
adapter = webContents;
adapter->initialize(this);
@@ -875,8 +889,12 @@ void QQuickWebEngineViewPrivate::setProfile(QQuickWebEngineProfile *profile)
if (adapter && adapter->browserContext() != browserContextAdapter()->browserContext()) {
// When the profile changes we need to create a new WebContentAdapter and reload the active URL.
QUrl activeUrl = adapter->activeUrl();
+ QQmlWebChannel *qmlWebChannel = qobject_cast<QQmlWebChannel *>(adapter->webChannel());
adapter = 0;
ensureContentsAdapter();
+ if (qmlWebChannel)
+ adapter->setWebChannel(qmlWebChannel);
+
if (!explicitUrl.isValid() && activeUrl.isValid())
adapter->load(activeUrl);
}
diff --git a/src/webengine/doc/src/qtwebengine-index.qdoc b/src/webengine/doc/src/qtwebengine-index.qdoc
index 671425e75..e30976ef3 100644
--- a/src/webengine/doc/src/qtwebengine-index.qdoc
+++ b/src/webengine/doc/src/qtwebengine-index.qdoc
@@ -42,29 +42,6 @@
\annotatedlist qtwebengine-qmlmodules
- \section1 Getting Started
-
- To include the definitions of the Qt WebEngineCore and Qt WebEngineWidgets modules' classes, use
- the following directives:
-
- \badcode
- #include <QtWebEngineCore>
- #include <QtWebEngineWidgets>
- \endcode
-
- To import the Qt WebEngine module's QML types, add the following import statement to your .qml
- file:
-
- \badcode
- import QtWebEngine 1.2
- \endcode
-
- To link against the modules, add QT variables to your qmake .pro file:
-
- \badcode
- QT += webengine webenginecore webenginewidgets
- \endcode
-
\section1 Articles and Guides
\list
diff --git a/src/webengine/doc/src/qtwebengine-overview.qdoc b/src/webengine/doc/src/qtwebengine-overview.qdoc
index cfe731c01..8be4adda0 100644
--- a/src/webengine/doc/src/qtwebengine-overview.qdoc
+++ b/src/webengine/doc/src/qtwebengine-overview.qdoc
@@ -140,7 +140,7 @@
schemes. Requests for the scheme are then issued to QWebEngineUrlSchemeHandler::requestStarted()
as QWebEngineUrlRequestJob objects.
- The QWebEngineCookieStoreClient class provides functions for accessing HTTP cookies of Chromium.
+ The QWebEngineCookieStore class provides functions for accessing HTTP cookies of Chromium.
The functions can be used to synchronize cookies with QNetworkAccessManager, as well as to set,
delete, and intercept cookies during navigation.
diff --git a/src/webengine/doc/src/qtwebengine-platform-notes.qdoc b/src/webengine/doc/src/qtwebengine-platform-notes.qdoc
index fdaa4f861..0898a72fc 100644
--- a/src/webengine/doc/src/qtwebengine-platform-notes.qdoc
+++ b/src/webengine/doc/src/qtwebengine-platform-notes.qdoc
@@ -49,4 +49,34 @@
\li Linux: Clang or GCC version 4.7 or later
\li OS X: Xcode version 5.1 or later
\endlist
+
+ \section1 Adobe Flash Player Plugin Support
+
+ Qt WebEngine supports the Adobe Flash player plugin that is a Pepper Plugin API (PPAPI)
+ plugin. The plugin must be installed in one of the following locations, depending on the
+ platform:
+
+ \list
+ \li Windows
+ \code
+ C:\Windows\SysWOW64\Macromed\Flash\pepflashplayer*.dll
+ C:\Windows\System32\Macromed\Flash\pepflashplayer*.dll
+ \endcode
+ \li OS X
+ \code
+ /Library/Internet Plug-Ins/PepperFlashPlayer/PepperFlashPlayer.plugin
+ \endcode
+ \li Linux
+ \code
+ /usr/lib/pepperflashplugin-nonfree/libpepflashplayer.so
+ /usr/lib/PepperFlash/libpepflashplayer.so
+ /usr/lib64/chromium/PepperFlash/libpepflashplayer.so
+ \endcode
+ \endlist
+
+ You can also load the Flash player from a specific location by using command line arguments:
+
+ \code
+ --ppapi-flash-path=./libpepflashplayer.so
+ \endcode
*/
diff --git a/src/webengine/doc/src/qtwebengine-qmlmodule.qdoc b/src/webengine/doc/src/qtwebengine-qmlmodule.qdoc
index e098071b3..89ff6f0b3 100644
--- a/src/webengine/doc/src/qtwebengine-qmlmodule.qdoc
+++ b/src/webengine/doc/src/qtwebengine-qmlmodule.qdoc
@@ -33,7 +33,13 @@
your .qml file:
\badcode
- import QtQuick 2.0
- import QtWebEngine 1.1
+ import QtWebEngine 1.2
+ \endcode
+
+ To link against the module, add the following QT variable to your qmake .pro
+ file:
+
+ \badcode
+ QT += webengine
\endcode
*/
diff --git a/src/webengine/plugin/plugins.qmltypes b/src/webengine/plugin/plugins.qmltypes
index 7a310d268..4fce34a21 100644
--- a/src/webengine/plugin/plugins.qmltypes
+++ b/src/webengine/plugin/plugins.qmltypes
@@ -611,7 +611,7 @@ Module {
name: "downloadFinished"
Parameter { name: "download"; type: "QQuickWebEngineDownloadItem"; isPointer: true }
}
- Method { name: "cookieStoreClient"; revision: 1; type: "QWebEngineCookieStoreClient*" }
+ Method { name: "cookieStore"; revision: 1; type: "QWebEngineCookieStore*" }
}
Component {
name: "QQuickWebEngineScript"
diff --git a/src/webenginewidgets/api/qwebenginehistory.cpp b/src/webenginewidgets/api/qwebenginehistory.cpp
index 9aed2aca9..05efb131d 100644
--- a/src/webenginewidgets/api/qwebenginehistory.cpp
+++ b/src/webenginewidgets/api/qwebenginehistory.cpp
@@ -42,6 +42,11 @@
QT_BEGIN_NAMESPACE
+/*!
+ \fn QWebEngineHistoryItem::swap(QWebEngineHistoryItem &other)
+ Swaps the history item with the \a other item.
+*/
+
QWebEngineHistoryItemPrivate::QWebEngineHistoryItemPrivate(QWebEnginePagePrivate *page, int index)
: page(page)
, index(index)
diff --git a/src/webenginewidgets/api/qwebengineprofile.cpp b/src/webenginewidgets/api/qwebengineprofile.cpp
index 5fbc4d63c..e1cde4f08 100644
--- a/src/webenginewidgets/api/qwebengineprofile.cpp
+++ b/src/webenginewidgets/api/qwebengineprofile.cpp
@@ -36,7 +36,7 @@
#include "qwebengineprofile.h"
-#include "qwebenginecookiestoreclient.h"
+#include "qwebenginecookiestore.h"
#include "qwebenginedownloaditem.h"
#include "qwebenginedownloaditem_p.h"
#include "qwebenginepage.h"
@@ -434,13 +434,13 @@ void QWebEngineProfile::setHttpCacheMaximumSize(int maxSize)
}
/*!
- Returns the cookie store client singleton, if one has been set.
+ Returns the cookie store singleton, if one has been set.
*/
-QWebEngineCookieStoreClient* QWebEngineProfile::cookieStoreClient()
+QWebEngineCookieStore* QWebEngineProfile::cookieStore()
{
Q_D(QWebEngineProfile);
- return d->browserContext()->cookieStoreClient();
+ return d->browserContext()->cookieStore();
}
@@ -568,7 +568,7 @@ void QWebEngineProfile::installUrlSchemeHandler(const QByteArray &scheme, QWebEn
return;
}
d->browserContext()->addCustomUrlSchemeHandler(scheme, handler);
- connect(handler, SIGNAL(destroyed(QWebEngineUrlSchemeHandler*)), this, SLOT(destroyedUrlSchemeHandler(QWebEngineUrlSchemeHandler*)));
+ connect(handler, SIGNAL(_q_destroyedUrlSchemeHandler(QWebEngineUrlSchemeHandler*)), this, SLOT(destroyedUrlSchemeHandler(QWebEngineUrlSchemeHandler*)));
}
/*!
@@ -584,7 +584,7 @@ void QWebEngineProfile::removeUrlSchemeHandler(QWebEngineUrlSchemeHandler *handl
Q_ASSERT(handler);
if (!d->browserContext()->removeCustomUrlSchemeHandler(handler))
return;
- disconnect(handler, SIGNAL(destroyed(QWebEngineUrlSchemeHandler*)), this, SLOT(destroyedUrlSchemeHandler(QWebEngineUrlSchemeHandler*)));
+ disconnect(handler, SIGNAL(_q_destroyedUrlSchemeHandler(QWebEngineUrlSchemeHandler*)), this, SLOT(destroyedUrlSchemeHandler(QWebEngineUrlSchemeHandler*)));
}
/*!
@@ -600,7 +600,7 @@ void QWebEngineProfile::removeUrlScheme(const QByteArray &scheme)
QWebEngineUrlSchemeHandler *handler = d->browserContext()->takeCustomUrlSchemeHandler(scheme);
if (!handler)
return;
- disconnect(handler, SIGNAL(destroyed(QWebEngineUrlSchemeHandler*)), this, SLOT(destroyedUrlSchemeHandler(QWebEngineUrlSchemeHandler*)));
+ disconnect(handler, SIGNAL(_q_destroyedUrlSchemeHandler(QWebEngineUrlSchemeHandler*)), this, SLOT(destroyedUrlSchemeHandler(QWebEngineUrlSchemeHandler*)));
}
/*!
diff --git a/src/webenginewidgets/api/qwebengineprofile.h b/src/webenginewidgets/api/qwebengineprofile.h
index 7e03c065c..416ef23db 100644
--- a/src/webenginewidgets/api/qwebengineprofile.h
+++ b/src/webenginewidgets/api/qwebengineprofile.h
@@ -47,7 +47,7 @@ QT_BEGIN_NAMESPACE
class QObject;
class QUrl;
-class QWebEngineCookieStoreClient;
+class QWebEngineCookieStore;
class QWebEngineDownloadItem;
class QWebEnginePage;
class QWebEnginePagePrivate;
@@ -99,7 +99,7 @@ public:
int httpCacheMaximumSize() const;
void setHttpCacheMaximumSize(int maxSize);
- QWebEngineCookieStoreClient* cookieStoreClient();
+ QWebEngineCookieStore* cookieStore();
void setRequestInterceptor(QWebEngineUrlRequestInterceptor *interceptor);
void clearAllVisitedLinks();
diff --git a/src/webenginewidgets/doc/src/qtwebkitportingguide.qdoc b/src/webenginewidgets/doc/src/qtwebkitportingguide.qdoc
index 927b08cb5..1f3e618c2 100644
--- a/src/webenginewidgets/doc/src/qtwebkitportingguide.qdoc
+++ b/src/webenginewidgets/doc/src/qtwebkitportingguide.qdoc
@@ -28,10 +28,9 @@
/*!
\page qtwebenginewidgets-qtwebkitportingguide.html
\title Porting from Qt WebKit to Qt WebEngine
- \brief This guide gives an overview of the differences between the Qt WebKit
- and Qt WebEngine APIs in applications.
+ \brief Overview of the differences between the Qt WebKit and Qt WebEngine API.
- This guide provides rough steps to follow when porting an application that uses the
+ The following sections contain information about porting an application that uses the
\l{http://doc.qt.io/archives/qt-5.3/qtwebkit-index.html}{Qt WebKit}
\l{http://doc.qt.io/archives/qt-5.3/qml-qtwebkit-webview.html}{QWebView API} to use the
\l{Qt WebEngine} QWebEngineView.
@@ -94,7 +93,7 @@
\endcode
- \section1 QWebFrame has been Merged into QWebEnginePage
+ \section1 QWebFrame Has Been Merged into QWebEnginePage
It is not possible to access sub-frames. Methods of the main QWebFrame are
now available directly through the QWebEnginePage itself.
@@ -113,12 +112,12 @@
\endcode
- \section1 Some methods now return their result asynchronously
+ \section1 Some Methods Now Return Their Result Asynchronously
- Since Qt WebEngine uses a multi-process architecture, applications needs
- to return to the event loop where the result will be received asynchronously
- from Qt WebEngine's render process. A function pointer, a functor or a lambda
- expression must be provided to handle the result when it is available.
+ Because Qt WebEngine uses a multi-process architecture, calls to some methods from applications
+ will return immediately, while the results should be received asynchronously via a callback
+ mechanism. A function pointer, a functor, or a lambda expression must be provided to handle the
+ results when they become available.
\b {Qt WebKit}
\code
@@ -178,14 +177,14 @@
\endcode
- \section1 Qt WebEngine does not Interact with QNetworkAccessManager
+ \section1 Qt WebEngine Does Not Interact with QNetworkAccessManager
Some classes of Qt Network such as QAuthenticator were reused for their interface
- but, unlike Qt WebKit, Qt WebEngine has its own HTTP implementation and can't
+ but, unlike Qt WebKit, Qt WebEngine has its own HTTP implementation and cannot
go through a QNetworkAccessManager.
- Signals and methods of QNetworkAccessManager that are still supported were
- moved to QWebEnginePage directly.
+ The signals and methods of QNetworkAccessManager that are still supported were
+ moved to the QWebEnginePage class.
\b {Qt WebKit}
\code
@@ -201,11 +200,11 @@
\endcode
- \section1 Notes about Individual Methods
+ \section1 Notes About Individual Methods
\section2 evaluateJavaScript
- QWebFrame::evaluateJavaScript was renamed and moved as QWebEnginePage::runJavaScript.
+ QWebFrame::evaluateJavaScript was moved and renamed as QWebEnginePage::runJavaScript.
It is currently only possible to run JavaScript on the main frame of a page and the
result is returned asynchronously to the provided functor.
@@ -243,15 +242,15 @@
\endcode
- \section1 Unavailable Qt WebKit APIs
+ \section1 Unavailable Qt WebKit API
- Qt WebKit classes and methods in this list will not be available in Qt WebEngine.
+ The Qt WebKit classes and methods in this list will not be available in Qt WebEngine.
\table
\row
\li QGraphicsWebView
- \li Qt WebEngine requires hardware acceleration. Since we couldn't support
- a web view class in a QGraphicsView unless it is attached to a QGLWidget
+ \li Qt WebEngine is designed for being used with hardware acceleration. Because we could not
+ support a web view class in a QGraphicsView unless it would be attached to a QGLWidget
viewport, this feature is out of scope.
\row
\li QWebElement
@@ -266,7 +265,7 @@
was dropped from the HTML5 standard.
\row
\li QWebPluginFactory, QWebPage::setPalette, QWebView::setRenderHints
- \li Qt WebEngine renders web pages using Skia and isn't using QPainter
+ \li Qt WebEngine renders web pages using Skia and is not using QPainter
or Qt for this purpose. The HTML5 standard also now offers much
better alternatives that were not available when native controls
plugins were introduced in Qt WebKit.
diff --git a/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc
index 6d3da026c..1eee2d187 100644
--- a/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc
+++ b/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc
@@ -541,9 +541,11 @@
/*!
\property QWebEnginePage::requestedUrl
- \brief the URL requested to be loaded by the frame currently viewed
+ \brief the URL that was originally requested to be loaded by the frame
+ that is currently viewed
- The URL may differ from the one returned by url() if a DNS resolution or a redirection occurs.
+ \note The URL may differ from the one returned by url(), which is the actual
+ URL that results from DNS resolution or redirection.
\sa url(), setUrl()
*/
diff --git a/tests/auto/core/core.pro b/tests/auto/core/core.pro
index 713c71d14..09b0dd69d 100644
--- a/tests/auto/core/core.pro
+++ b/tests/auto/core/core.pro
@@ -1,5 +1,5 @@
TEMPLATE = subdirs
SUBDIRS += \
- qwebenginecookiestoreclient \
+ qwebenginecookiestore \
qwebengineurlrequestinterceptor \
diff --git a/tests/auto/core/qwebenginecookiestoreclient/qwebenginecookiestoreclient.pro b/tests/auto/core/qwebenginecookiestore/qwebenginecookiestore.pro
index e99c7f493..e99c7f493 100644
--- a/tests/auto/core/qwebenginecookiestoreclient/qwebenginecookiestoreclient.pro
+++ b/tests/auto/core/qwebenginecookiestore/qwebenginecookiestore.pro
diff --git a/tests/auto/core/qwebenginecookiestoreclient/resources/content.html b/tests/auto/core/qwebenginecookiestore/resources/content.html
index 360ad65ef..360ad65ef 100644
--- a/tests/auto/core/qwebenginecookiestoreclient/resources/content.html
+++ b/tests/auto/core/qwebenginecookiestore/resources/content.html
diff --git a/tests/auto/core/qwebenginecookiestoreclient/resources/index.html b/tests/auto/core/qwebenginecookiestore/resources/index.html
index d41866712..d41866712 100644
--- a/tests/auto/core/qwebenginecookiestoreclient/resources/index.html
+++ b/tests/auto/core/qwebenginecookiestore/resources/index.html
diff --git a/tests/auto/core/qwebenginecookiestoreclient/tst_qwebenginecookiestoreclient.cpp b/tests/auto/core/qwebenginecookiestore/tst_qwebenginecookiestore.cpp
index ed2a5a55b..9436b093e 100644
--- a/tests/auto/core/qwebenginecookiestoreclient/tst_qwebenginecookiestoreclient.cpp
+++ b/tests/auto/core/qwebenginecookiestore/tst_qwebenginecookiestore.cpp
@@ -42,18 +42,18 @@
#include "../../widgets/util.h"
#include <QtTest/QtTest>
#include <QtWebEngineCore/qwebenginecallback.h>
-#include <QtWebEngineCore/qwebenginecookiestoreclient.h>
+#include <QtWebEngineCore/qwebenginecookiestore.h>
#include <QtWebEngineWidgets/qwebenginepage.h>
#include <QtWebEngineWidgets/qwebengineprofile.h>
#include <QtWebEngineWidgets/qwebengineview.h>
-class tst_QWebEngineCookieStoreClient : public QObject
+class tst_QWebEngineCookieStore : public QObject
{
Q_OBJECT
public:
- tst_QWebEngineCookieStoreClient();
- ~tst_QWebEngineCookieStoreClient();
+ tst_QWebEngineCookieStore();
+ ~tst_QWebEngineCookieStore();
public Q_SLOTS:
void init();
@@ -67,34 +67,34 @@ private Q_SLOTS:
void batchCookieTasks();
};
-tst_QWebEngineCookieStoreClient::tst_QWebEngineCookieStoreClient()
+tst_QWebEngineCookieStore::tst_QWebEngineCookieStore()
{
}
-tst_QWebEngineCookieStoreClient::~tst_QWebEngineCookieStoreClient()
+tst_QWebEngineCookieStore::~tst_QWebEngineCookieStore()
{
}
-void tst_QWebEngineCookieStoreClient::init()
+void tst_QWebEngineCookieStore::init()
{
}
-void tst_QWebEngineCookieStoreClient::cleanup()
+void tst_QWebEngineCookieStore::cleanup()
{
}
-void tst_QWebEngineCookieStoreClient::initTestCase()
+void tst_QWebEngineCookieStore::initTestCase()
{
}
-void tst_QWebEngineCookieStoreClient::cleanupTestCase()
+void tst_QWebEngineCookieStore::cleanupTestCase()
{
}
-void tst_QWebEngineCookieStoreClient::cookieSignals()
+void tst_QWebEngineCookieStore::cookieSignals()
{
QWebEngineView view;
- QWebEngineCookieStoreClient *client = view.page()->profile()->cookieStoreClient();
+ QWebEngineCookieStore *client = view.page()->profile()->cookieStore();
QSignalSpy loadSpy(&view, SIGNAL(loadFinished(bool)));
QSignalSpy cookieAddedSpy(client, SIGNAL(cookieAdded(const QNetworkCookie &)));
@@ -119,11 +119,10 @@ void tst_QWebEngineCookieStoreClient::cookieSignals()
QTRY_COMPARE(cookieRemovedSpy.count(), 1);
}
-void tst_QWebEngineCookieStoreClient::setAndDeleteCookie()
+void tst_QWebEngineCookieStore::setAndDeleteCookie()
{
- QTest::qWait(500); // remove, when QTBUG-47946 is fixed!
QWebEngineView view;
- QWebEngineCookieStoreClient *client = view.page()->profile()->cookieStoreClient();
+ QWebEngineCookieStore *client = view.page()->profile()->cookieStore();
QSignalSpy loadSpy(&view, SIGNAL(loadFinished(bool)));
QSignalSpy cookieAddedSpy(client, SIGNAL(cookieAdded(const QNetworkCookie &)));
@@ -157,11 +156,10 @@ void tst_QWebEngineCookieStoreClient::setAndDeleteCookie()
QTRY_COMPARE(cookieRemovedSpy.count(), 2);
}
-void tst_QWebEngineCookieStoreClient::batchCookieTasks()
+void tst_QWebEngineCookieStore::batchCookieTasks()
{
- QTest::qWait(500); // remove, when QTBUG-47946 is fixed!
QWebEngineView view;
- QWebEngineCookieStoreClient *client = view.page()->profile()->cookieStoreClient();
+ QWebEngineCookieStore *client = view.page()->profile()->cookieStore();
QSignalSpy loadSpy(&view, SIGNAL(loadFinished(bool)));
QSignalSpy cookieAddedSpy(client, SIGNAL(cookieAdded(const QNetworkCookie &)));
@@ -206,5 +204,5 @@ void tst_QWebEngineCookieStoreClient::batchCookieTasks()
QTRY_COMPARE(capture, 3);
}
-QTEST_MAIN(tst_QWebEngineCookieStoreClient)
-#include "tst_qwebenginecookiestoreclient.moc"
+QTEST_MAIN(tst_QWebEngineCookieStore)
+#include "tst_qwebenginecookiestore.moc"
diff --git a/tests/auto/core/qwebenginecookiestoreclient/tst_qwebenginecookiestoreclient.qrc b/tests/auto/core/qwebenginecookiestore/tst_qwebenginecookiestore.qrc
index afeae268b..afeae268b 100644
--- a/tests/auto/core/qwebenginecookiestoreclient/tst_qwebenginecookiestoreclient.qrc
+++ b/tests/auto/core/qwebenginecookiestore/tst_qwebenginecookiestore.qrc
diff --git a/tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.cpp b/tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.cpp
index 4a261c46b..c4461f1c1 100644
--- a/tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.cpp
+++ b/tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.cpp
@@ -100,15 +100,14 @@ public:
QList<QUrl> firstPartyUrls;
bool shouldIntercept;
- bool interceptRequest(QWebEngineUrlRequestInfo &info) override
+ void interceptRequest(QWebEngineUrlRequestInfo &info) override
{
info.block(info.requestMethod() != QByteArrayLiteral("GET"));
- if (info.requestUrl().toString().endsWith(QLatin1String("__placeholder__")))
+ if (shouldIntercept && info.requestUrl().toString().endsWith(QLatin1String("__placeholder__")))
info.redirect(QUrl("qrc:///resources/content.html"));
observedUrls.append(info.requestUrl());
firstPartyUrls.append(info.firstPartyUrl());
- return shouldIntercept;
}
TestRequestInterceptor(bool intercept)
: shouldIntercept(intercept)
@@ -162,11 +161,10 @@ class LocalhostContentProvider : public QWebEngineUrlRequestInterceptor
public:
LocalhostContentProvider() { }
- bool interceptRequest(QWebEngineUrlRequestInfo &info) override
+ void interceptRequest(QWebEngineUrlRequestInfo &info) override
{
requestedUrls.append(info.requestUrl());
info.redirect(QUrl("data:text/html,<p>hello"));
- return true;
}
QList<QUrl> requestedUrls;
diff --git a/tests/auto/quick/publicapi/tst_publicapi.cpp b/tests/auto/quick/publicapi/tst_publicapi.cpp
index bf0192e42..135d9167f 100644
--- a/tests/auto/quick/publicapi/tst_publicapi.cpp
+++ b/tests/auto/quick/publicapi/tst_publicapi.cpp
@@ -89,7 +89,7 @@ static QStringList hardcodedTypes = QStringList()
// Ignore the testSupport types without making a fuss.
<< "QQuickWebEngineTestSupport*"
<< "QQuickWebEngineErrorPage*"
- << "QWebEngineCookieStoreClient*"
+ << "QWebEngineCookieStore*"
;
static QStringList expectedAPI = QStringList()
@@ -289,7 +289,7 @@ static QStringList expectedAPI = QStringList()
<< "QQuickWebEngineProfile.httpAcceptLanguageChanged() --> void"
<< "QQuickWebEngineProfile.downloadRequested(QQuickWebEngineDownloadItem*) --> void"
<< "QQuickWebEngineProfile.downloadFinished(QQuickWebEngineDownloadItem*) --> void"
- << "QQuickWebEngineProfile.setCookieStoreClient(QWebEngineCookieStoreClient*) --> void"
+ << "QQuickWebEngineProfile.setCookieStore(QWebEngineCookieStore*) --> void"
<< "QQuickWebEngineScript.Deferred --> InjectionPoint"
<< "QQuickWebEngineScript.DocumentReady --> InjectionPoint"
<< "QQuickWebEngineScript.DocumentCreation --> InjectionPoint"
diff --git a/tests/quicktestbrowser/main.cpp b/tests/quicktestbrowser/main.cpp
index 167f67dc3..12ebfa2d5 100644
--- a/tests/quicktestbrowser/main.cpp
+++ b/tests/quicktestbrowser/main.cpp
@@ -52,7 +52,7 @@ typedef QGuiApplication Application;
#include <QtQml/QQmlContext>
#include <QtQml/QQmlComponent>
#include <QtWebEngine/qtwebengineglobal.h>
-#include <QtWebEngineCore/qwebenginecookiestoreclient.h>
+#include <QtWebEngineCore/qwebenginecookiestore.h>
static QUrl startupUrl()
{
@@ -93,12 +93,12 @@ int main(int argc, char **argv)
, QUrl());
QObject *profile = component.create();
const QMetaObject *rootMeta = rootObject->metaObject();
- QWebEngineCookieStoreClient *client = 0;
- QMetaObject::invokeMethod(profile, "cookieStoreClient", Q_RETURN_ARG(QWebEngineCookieStoreClient*, client));
+ QWebEngineCookieStore *client = 0;
+ QMetaObject::invokeMethod(profile, "cookieStore", Q_RETURN_ARG(QWebEngineCookieStore*, client));
int index = rootMeta->indexOfProperty("thirdPartyCookiesEnabled");
Q_ASSERT(index != -1);
QMetaProperty thirdPartyCookiesProperty = rootMeta->property(index);
- client->setCookieFilter([rootObject,&thirdPartyCookiesProperty](const QWebEngineCookieStoreClient::FilterRequest&){ return thirdPartyCookiesProperty.read(rootObject).toBool(); });
+ client->setCookieFilter([rootObject,&thirdPartyCookiesProperty](const QWebEngineCookieStore::FilterRequest&){ return thirdPartyCookiesProperty.read(rootObject).toBool(); });
index = rootMeta->indexOfProperty("testProfile");
Q_ASSERT(index != -1);
diff --git a/tools/buildscripts/gyp_qtwebengine b/tools/buildscripts/gyp_qtwebengine
index b2ff4cbc4..ec24caeb1 100755
--- a/tools/buildscripts/gyp_qtwebengine
+++ b/tools/buildscripts/gyp_qtwebengine
@@ -132,6 +132,14 @@ if __name__ == '__main__':
# list.
args.append('--no-circular-check')
+ # libtool on Mac warns about duplicate basenames in static libraries, so
+ # they're disallowed in general by gyp. We are lax on this point, so disable
+ # this check other than on Mac. GN does not use static libraries as heavily,
+ # so over time this restriction will mostly go away anyway, even on Mac.
+ # https://code.google.com/p/gyp/issues/detail?id=384
+ if sys.platform != 'darwin':
+ args.append('--no-duplicate-basename-check')
+
args.extend(['-D', 'webkit_src_dir=' + chrome_src + '/third_party/WebKit'])
# the top_level source directory is the first common ancestor of our module and the chromium source tree for the build to be sane.
# commonprefix works on a character basis, so it might return a phony common prefix (not the common parent directory we expect),
diff --git a/tools/qmake/mkspecs/features/functions.prf b/tools/qmake/mkspecs/features/functions.prf
index d5265ab00..2c75f4984 100644
--- a/tools/qmake/mkspecs/features/functions.prf
+++ b/tools/qmake/mkspecs/features/functions.prf
@@ -163,17 +163,30 @@ defineTest(use?) {
}
defineReplace(findOrBuildNinja) {
- # If NINJA_PATH env var is set, prefer that.
- # Fallback to locating our own bootstrapped ninja.
- out = $(NINJA_PATH)
- !exists($$out) {
- out = $$absolute_path("$${getChromiumSrcDir()}/../ninja/ninja", "$$QTWEBENGINE_ROOT")
- win32: out = $$system_path($${out}.exe)
+ # If NINJA_PATH env var is set, prefer that.
+ # Fallback to locating our own bootstrapped ninja.
+ out = $(NINJA_PATH)
+ !exists($$out) {
+ src_3rd_party_dir = $$absolute_path("$${getChromiumSrcDir()}/../", "$$QTWEBENGINE_ROOT")
+
+ out = $$shadowed($$absolute_path("ninja/ninja", "$$src_3rd_party_dir"))
+ win32: out = $${out}.exe
- # If we did not find ninja, then we bootstrap it.
- !exists($$out): system("cd $$dirname(out) && python configure.py --bootstrap")
+ out = $$system_path($$out)
+ # If we did not find ninja, then we bootstrap it.
+ !exists($$out) {
+ # If we are making a shadow build, copy the ninja sources to the build directory.
+ !equals(PWD, $${OUT_PWD}) {
+ log("Build directory is different from source directory - copying ninja sources to the build tree...")
+ shadow_3rd_party_path = $$system_path($$shadowed($$src_3rd_party_dir))
+
+ !exists($$dirname(out)): mkpath($$shadow_3rd_party_path)
+ system("$$QMAKE_COPY_DIR $$system_quote($$system_path($$absolute_path("ninja", "$$src_3rd_party_dir"))) $$system_quote($$shadow_3rd_party_path)")
+ }
+ system("cd $$system_quote($$dirname(out)) && python configure.py --bootstrap")
}
- return($$out)
+ }
+ return($$out)
}
defineTest(skipBuild) {